diff --git a/.changeset/shaggy-games-appear.md b/.changeset/shaggy-games-appear.md new file mode 100644 index 0000000000..ffe3d0be79 --- /dev/null +++ b/.changeset/shaggy-games-appear.md @@ -0,0 +1,6 @@ +--- +"@hey-api/openapi-ts": patch +"@hey-api/shared": patch +--- + +**output**: fix: surface postprocess errors diff --git a/.oxfmtrc.json b/.oxfmtrc.json index 53b903695f..c4e3a1d7a9 100644 --- a/.oxfmtrc.json +++ b/.oxfmtrc.json @@ -7,7 +7,6 @@ "**/node_modules/", "temp/", "dev/.gen/", - "examples/openapi-ts-openai/src/client/**/*.ts", "**/test/generated/", "**/__snapshots__/", "**/.next/", diff --git a/eslint.config.js b/eslint.config.js index be1860d746..7a00ae18c2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -52,6 +52,14 @@ export default tseslint.config( '@typescript-eslint/no-require-imports': 'off', }, }, + { + files: ['**/*.gen.ts'], + rules: { + 'sort-keys-fix/sort-keys-fix': 'off', + 'typescript-sort-keys/interface': 'off', + 'typescript-sort-keys/string-enum': 'off', + }, + }, { ignores: [ '**/.tsdown/', @@ -60,8 +68,6 @@ export default tseslint.config( 'temp/', 'dev/gen/', 'dev/playground.ts', - 'examples/openapi-ts-nestjs/src/client/**/*.ts', - 'examples/openapi-ts-openai/src/client/**/*.ts', '**/test/generated/', '**/__snapshots__/', '**/.next/', diff --git a/examples/openapi-ts-angular-common/src/client/@angular/common.gen.ts b/examples/openapi-ts-angular-common/src/client/@angular/common.gen.ts index 5c20740f00..4cfed7e12f 100644 --- a/examples/openapi-ts-angular-common/src/client/@angular/common.gen.ts +++ b/examples/openapi-ts-angular-common/src/client/@angular/common.gen.ts @@ -50,8 +50,8 @@ export const addPetRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'POST', responseStyle: 'data', + method: 'POST', url: '/pet', ...options, }); @@ -65,8 +65,8 @@ export const updatePetRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'PUT', responseStyle: 'data', + method: 'PUT', url: '/pet', ...options, }); @@ -80,8 +80,8 @@ export const findPetsByStatusRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/pet/findByStatus', ...options, }); @@ -95,8 +95,8 @@ export const findPetsByTagsRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/pet/findByTags', ...options, }); @@ -110,8 +110,8 @@ export const deletePetRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'DELETE', responseStyle: 'data', + method: 'DELETE', url: '/pet/{petId}', ...options, }); @@ -125,8 +125,8 @@ export const getPetByIdRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/pet/{petId}', ...options, }); @@ -140,8 +140,8 @@ export const updatePetWithFormRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'POST', responseStyle: 'data', + method: 'POST', url: '/pet/{petId}', ...options, }); @@ -155,8 +155,8 @@ export const uploadFileRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'POST', responseStyle: 'data', + method: 'POST', url: '/pet/{petId}/uploadImage', ...options, }); @@ -170,8 +170,8 @@ export const getInventoryRequest = ( options?: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/store/inventory', ...options, }); @@ -185,8 +185,8 @@ export const placeOrderRequest = ( options?: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'POST', responseStyle: 'data', + method: 'POST', url: '/store/order', ...options, }); @@ -200,8 +200,8 @@ export const deleteOrderRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'DELETE', responseStyle: 'data', + method: 'DELETE', url: '/store/order/{orderId}', ...options, }); @@ -215,8 +215,8 @@ export const getOrderByIdRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/store/order/{orderId}', ...options, }); @@ -230,8 +230,8 @@ export const createUserRequest = ( options?: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'POST', responseStyle: 'data', + method: 'POST', url: '/user', ...options, }); @@ -245,8 +245,8 @@ export const createUsersWithListInputRequest = , ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'POST', responseStyle: 'data', + method: 'POST', url: '/user/createWithList', ...options, }); @@ -260,8 +260,8 @@ export const loginUserRequest = ( options?: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/user/login', ...options, }); @@ -275,8 +275,8 @@ export const logoutUserRequest = ( options?: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/user/logout', ...options, }); @@ -290,8 +290,8 @@ export const deleteUserRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'DELETE', responseStyle: 'data', + method: 'DELETE', url: '/user/{username}', ...options, }); @@ -305,8 +305,8 @@ export const getUserByNameRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'GET', responseStyle: 'data', + method: 'GET', url: '/user/{username}', ...options, }); @@ -320,8 +320,8 @@ export const updateUserRequest = ( options: Options, ): HttpRequest => (options?.client ?? client).requestOptions({ - method: 'PUT', responseStyle: 'data', + method: 'PUT', url: '/user/{username}', ...options, }); diff --git a/examples/openapi-ts-angular-common/src/client/schemas.gen.ts b/examples/openapi-ts-angular-common/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-angular-common/src/client/schemas.gen.ts +++ b/examples/openapi-ts-angular-common/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-angular-common/src/client/types.gen.ts b/examples/openapi-ts-angular-common/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-angular-common/src/client/types.gen.ts +++ b/examples/openapi-ts-angular-common/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-angular/src/client/schemas.gen.ts b/examples/openapi-ts-angular/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-angular/src/client/schemas.gen.ts +++ b/examples/openapi-ts-angular/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-angular/src/client/types.gen.ts b/examples/openapi-ts-angular/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-angular/src/client/types.gen.ts +++ b/examples/openapi-ts-angular/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-axios/src/client/schemas.gen.ts b/examples/openapi-ts-axios/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-axios/src/client/schemas.gen.ts +++ b/examples/openapi-ts-axios/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-axios/src/client/types.gen.ts b/examples/openapi-ts-axios/src/client/types.gen.ts index 48a6cd4a7b..eece005808 100644 --- a/examples/openapi-ts-axios/src/client/types.gen.ts +++ b/examples/openapi-ts-axios/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-fastify/src/client/fastify.gen.ts b/examples/openapi-ts-fastify/src/client/fastify.gen.ts index e61a8453c1..29d818c3ec 100644 --- a/examples/openapi-ts-fastify/src/client/fastify.gen.ts +++ b/examples/openapi-ts-fastify/src/client/fastify.gen.ts @@ -11,13 +11,13 @@ import type { } from './types.gen'; export type RouteHandlers = { - createPets: RouteHandler<{ - Reply: CreatePetsResponses; - }>; listPets: RouteHandler<{ Querystring?: ListPetsData['query']; Reply: ListPetsResponses; }>; + createPets: RouteHandler<{ + Reply: CreatePetsResponses; + }>; showPetById: RouteHandler<{ Params: ShowPetByIdData['path']; Reply: ShowPetByIdResponses; diff --git a/examples/openapi-ts-fetch/src/client/schemas.gen.ts b/examples/openapi-ts-fetch/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-fetch/src/client/schemas.gen.ts +++ b/examples/openapi-ts-fetch/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-fetch/src/client/types.gen.ts b/examples/openapi-ts-fetch/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-fetch/src/client/types.gen.ts +++ b/examples/openapi-ts-fetch/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-ky/src/client/schemas.gen.ts b/examples/openapi-ts-ky/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-ky/src/client/schemas.gen.ts +++ b/examples/openapi-ts-ky/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-ky/src/client/types.gen.ts b/examples/openapi-ts-ky/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-ky/src/client/types.gen.ts +++ b/examples/openapi-ts-ky/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-next/src/client/types.gen.ts b/examples/openapi-ts-next/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-next/src/client/types.gen.ts +++ b/examples/openapi-ts-next/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-ofetch/src/client/schemas.gen.ts b/examples/openapi-ts-ofetch/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-ofetch/src/client/schemas.gen.ts +++ b/examples/openapi-ts-ofetch/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-ofetch/src/client/types.gen.ts b/examples/openapi-ts-ofetch/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-ofetch/src/client/types.gen.ts +++ b/examples/openapi-ts-ofetch/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-openai/src/client/client.gen.ts b/examples/openapi-ts-openai/src/client/client.gen.ts index bb861f559b..61a6958eea 100644 --- a/examples/openapi-ts-openai/src/client/client.gen.ts +++ b/examples/openapi-ts-openai/src/client/client.gen.ts @@ -11,6 +11,10 @@ import type { ClientOptions as ClientOptions2 } from './types.gen'; * `setConfig()`. This is useful for example if you're using Next.js * to ensure your client always has the correct values. */ -export type CreateClientConfig = (override?: Config) => Config & T>; +export type CreateClientConfig = ( + override?: Config, +) => Config & T>; -export const client = createClient(createConfig({ baseUrl: 'https://api.openai.com/v1' })); +export const client = createClient( + createConfig({ baseUrl: 'https://api.openai.com/v1' }), +); diff --git a/examples/openapi-ts-openai/src/client/client/types.gen.ts b/examples/openapi-ts-openai/src/client/client/types.gen.ts index 9813eeaba6..40b36acc72 100644 --- a/examples/openapi-ts-openai/src/client/client/types.gen.ts +++ b/examples/openapi-ts-openai/src/client/client/types.gen.ts @@ -1,10 +1,7 @@ // This file is auto-generated by @hey-api/openapi-ts import type { Auth } from '../core/auth.gen'; -import type { - ServerSentEventsOptions, - ServerSentEventsResult, -} from '../core/serverSentEvents.gen'; +import type { ServerSentEventsOptions, ServerSentEventsResult } from '../core/serverSentEvents.gen'; import type { Client as CoreClient, Config as CoreConfig } from '../core/types.gen'; import type { Middleware } from './utils.gen'; diff --git a/examples/openapi-ts-openai/src/client/index.ts b/examples/openapi-ts-openai/src/client/index.ts index a04c885241..87dd223a30 100644 --- a/examples/openapi-ts-openai/src/client/index.ts +++ b/examples/openapi-ts-openai/src/client/index.ts @@ -1,4 +1,1156 @@ // This file is auto-generated by @hey-api/openapi-ts export { OpenAi, type Options } from './sdk.gen'; -export { type ActivateOrganizationCertificatesData, type ActivateOrganizationCertificatesResponse, type ActivateOrganizationCertificatesResponses, type ActivateProjectCertificatesData, type ActivateProjectCertificatesResponse, type ActivateProjectCertificatesResponses, type AddUploadPartData, type AddUploadPartRequest, type AddUploadPartResponse, type AddUploadPartResponses, type AdminApiKey, type AdminApiKeysCreateData, type AdminApiKeysCreateResponse, type AdminApiKeysCreateResponses, type AdminApiKeysDeleteData, type AdminApiKeysDeleteResponse, type AdminApiKeysDeleteResponses, type AdminApiKeysGetData, type AdminApiKeysGetResponse, type AdminApiKeysGetResponses, type AdminApiKeysListData, type AdminApiKeysListResponse, type AdminApiKeysListResponses, type Annotation, type ApiKeyList, type ApproximateLocation, type ArchiveProjectData, type ArchiveProjectResponse, type ArchiveProjectResponses, type AssistantObject, type AssistantsApiResponseFormatOption, type AssistantsApiToolChoiceOption, type AssistantsNamedToolChoice, type AssistantStreamEvent, AssistantSupportedModels, type AssistantTool, type AssistantToolsCode, type AssistantToolsFileSearch, type AssistantToolsFileSearchTypeOnly, type AssistantToolsFunction, AudioResponseFormat, type AuditLog, type AuditLogActor, type AuditLogActorApiKey, type AuditLogActorServiceAccount, type AuditLogActorSession, type AuditLogActorUser, AuditLogEventType, type AutoChunkingStrategyRequestParam, type Batch, type BatchError, type BatchFileExpirationAfter, type BatchRequestCounts, type BatchRequestInput, type BatchRequestOutput, type CancelBatchData, type CancelBatchResponse, type CancelBatchResponses, type CancelEvalRunData, type CancelEvalRunResponse, type CancelEvalRunResponses, type CancelFineTuningJobData, type CancelFineTuningJobResponse, type CancelFineTuningJobResponses, type CancelResponseData, type CancelResponseError, type CancelResponseErrors, type CancelResponseResponse, type CancelResponseResponses, type CancelRunData, type CancelRunResponse, type CancelRunResponses, type CancelUploadData, type CancelUploadResponse, type CancelUploadResponses, type CancelVectorStoreFileBatchData, type CancelVectorStoreFileBatchResponse, type CancelVectorStoreFileBatchResponses, type Certificate, type ChatCompletionAllowedTools, type ChatCompletionAllowedToolsChoice, type ChatCompletionDeleted, type ChatCompletionFunctionCallOption, type ChatCompletionFunctions, type ChatCompletionList, type ChatCompletionMessageCustomToolCall, type ChatCompletionMessageList, type ChatCompletionMessageToolCall, type ChatCompletionMessageToolCallChunk, type ChatCompletionMessageToolCalls, type ChatCompletionModalities, type ChatCompletionNamedToolChoice, type ChatCompletionNamedToolChoiceCustom, type ChatCompletionRequestAssistantMessage, type ChatCompletionRequestAssistantMessageContentPart, type ChatCompletionRequestDeveloperMessage, type ChatCompletionRequestFunctionMessage, type ChatCompletionRequestMessage, type ChatCompletionRequestMessageContentPartAudio, type ChatCompletionRequestMessageContentPartFile, type ChatCompletionRequestMessageContentPartImage, type ChatCompletionRequestMessageContentPartRefusal, type ChatCompletionRequestMessageContentPartText, type ChatCompletionRequestSystemMessage, type ChatCompletionRequestSystemMessageContentPart, type ChatCompletionRequestToolMessage, type ChatCompletionRequestToolMessageContentPart, type ChatCompletionRequestUserMessage, type ChatCompletionRequestUserMessageContentPart, type ChatCompletionResponseMessage, ChatCompletionRole, type ChatCompletionStreamOptions, type ChatCompletionStreamResponseDelta, type ChatCompletionTokenLogprob, type ChatCompletionTool, type ChatCompletionToolChoiceOption, ChatModel, type ChunkingStrategyRequestParam, type ChunkingStrategyResponse, type Click, type ClientOptions, type CodeInterpreterFileOutput, type CodeInterpreterOutputImage, type CodeInterpreterOutputLogs, type CodeInterpreterTextOutput, type CodeInterpreterTool, type CodeInterpreterToolAuto, type CodeInterpreterToolCall, type ComparisonFilter, type CompleteUploadData, type CompleteUploadRequest, type CompleteUploadResponse, type CompleteUploadResponses, type CompletionUsage, type CompoundFilter, type ComputerAction, type ComputerCallOutputItemParam, type ComputerCallSafetyCheckParam, type ComputerScreenshotImage, type ComputerToolCall, type ComputerToolCallOutput, type ComputerToolCallOutputResource, type ComputerToolCallSafetyCheck, type ComputerUsePreviewTool, type ContainerFileCitationBody, type ContainerFileListResource, type ContainerFileResource, type ContainerListResource, type ContainerResource, type Content, type Coordinate, type CostsResult, type CreateAssistantData, type CreateAssistantRequest, type CreateAssistantResponse, type CreateAssistantResponses, type CreateBatchData, type CreateBatchResponse, type CreateBatchResponses, type CreateChatCompletionData, type CreateChatCompletionRequest, type CreateChatCompletionResponse, type CreateChatCompletionResponse2, type CreateChatCompletionResponses, type CreateChatCompletionStreamResponse, type CreateCompletionData, type CreateCompletionRequest, type CreateCompletionResponse, type CreateCompletionResponse2, type CreateCompletionResponses, type CreateContainerBody, type CreateContainerData, type CreateContainerFileBody, type CreateContainerFileData, type CreateContainerFileResponse, type CreateContainerFileResponses, type CreateContainerResponse, type CreateContainerResponses, type CreateEmbeddingData, type CreateEmbeddingRequest, type CreateEmbeddingResponse, type CreateEmbeddingResponse2, type CreateEmbeddingResponses, type CreateEvalCompletionsRunDataSource, type CreateEvalCustomDataSourceConfig, type CreateEvalData, type CreateEvalItem, type CreateEvalJsonlRunDataSource, type CreateEvalLabelModelGrader, type CreateEvalLogsDataSourceConfig, type CreateEvalRequest, type CreateEvalResponse, type CreateEvalResponses, type CreateEvalResponsesRunDataSource, type CreateEvalRunData, type CreateEvalRunError, type CreateEvalRunErrors, type CreateEvalRunRequest, type CreateEvalRunResponse, type CreateEvalRunResponses, type CreateEvalStoredCompletionsDataSourceConfig, type CreateFileData, type CreateFileRequest, type CreateFileResponse, type CreateFileResponses, type CreateFineTuningCheckpointPermissionData, type CreateFineTuningCheckpointPermissionRequest, type CreateFineTuningCheckpointPermissionResponse, type CreateFineTuningCheckpointPermissionResponses, type CreateFineTuningJobData, type CreateFineTuningJobRequest, type CreateFineTuningJobResponse, type CreateFineTuningJobResponses, type CreateImageData, type CreateImageEditData, type CreateImageEditRequest, type CreateImageEditResponse, type CreateImageEditResponses, type CreateImageRequest, type CreateImageResponse, type CreateImageResponses, type CreateImageVariationData, type CreateImageVariationRequest, type CreateImageVariationResponse, type CreateImageVariationResponses, type CreateMessageData, type CreateMessageRequest, type CreateMessageResponse, type CreateMessageResponses, type CreateModelResponseProperties, type CreateModerationData, type CreateModerationRequest, type CreateModerationResponse, type CreateModerationResponse2, type CreateModerationResponses, type CreateProjectData, type CreateProjectResponse, type CreateProjectResponses, type CreateProjectServiceAccountData, type CreateProjectServiceAccountError, type CreateProjectServiceAccountErrors, type CreateProjectServiceAccountResponse, type CreateProjectServiceAccountResponses, type CreateProjectUserData, type CreateProjectUserError, type CreateProjectUserErrors, type CreateProjectUserResponse, type CreateProjectUserResponses, type CreateRealtimeSessionData, type CreateRealtimeSessionResponse, type CreateRealtimeSessionResponses, type CreateRealtimeTranscriptionSessionData, type CreateRealtimeTranscriptionSessionResponse, type CreateRealtimeTranscriptionSessionResponses, type CreateResponse, type CreateResponseData, type CreateResponseResponse, type CreateResponseResponses, type CreateRunData, type CreateRunRequest, type CreateRunRequestWithoutStream, type CreateRunResponse, type CreateRunResponses, type CreateSpeechData, type CreateSpeechRequest, type CreateSpeechResponse, type CreateSpeechResponses, type CreateSpeechResponseStreamEvent, type CreateThreadAndRunData, type CreateThreadAndRunRequest, type CreateThreadAndRunRequestWithoutStream, type CreateThreadAndRunResponse, type CreateThreadAndRunResponses, type CreateThreadData, type CreateThreadRequest, type CreateThreadResponse, type CreateThreadResponses, type CreateTranscriptionData, type CreateTranscriptionRequest, type CreateTranscriptionResponse, type CreateTranscriptionResponseJson, type CreateTranscriptionResponses, type CreateTranscriptionResponseStreamEvent, type CreateTranscriptionResponseVerboseJson, type CreateTranslationData, type CreateTranslationRequest, type CreateTranslationResponse, type CreateTranslationResponseJson, type CreateTranslationResponses, type CreateTranslationResponseVerboseJson, type CreateUploadData, type CreateUploadRequest, type CreateUploadResponse, type CreateUploadResponses, type CreateVectorStoreData, type CreateVectorStoreFileBatchData, type CreateVectorStoreFileBatchRequest, type CreateVectorStoreFileBatchResponse, type CreateVectorStoreFileBatchResponses, type CreateVectorStoreFileData, type CreateVectorStoreFileRequest, type CreateVectorStoreFileResponse, type CreateVectorStoreFileResponses, type CreateVectorStoreRequest, type CreateVectorStoreResponse, type CreateVectorStoreResponses, type CustomTool, type CustomToolCall, type CustomToolCallOutput, type CustomToolChatCompletions, type DeactivateOrganizationCertificatesData, type DeactivateOrganizationCertificatesResponse, type DeactivateOrganizationCertificatesResponses, type DeactivateProjectCertificatesData, type DeactivateProjectCertificatesResponse, type DeactivateProjectCertificatesResponses, type DeleteAssistantData, type DeleteAssistantResponse, type DeleteAssistantResponse2, type DeleteAssistantResponses, type DeleteCertificateData, type DeleteCertificateResponse, type DeleteCertificateResponse2, type DeleteCertificateResponses, type DeleteChatCompletionData, type DeleteChatCompletionResponse, type DeleteChatCompletionResponses, type DeleteContainerData, type DeleteContainerFileData, type DeleteContainerFileResponses, type DeleteContainerResponses, type DeleteEvalData, type DeleteEvalError, type DeleteEvalErrors, type DeleteEvalResponse, type DeleteEvalResponses, type DeleteEvalRunData, type DeleteEvalRunError, type DeleteEvalRunErrors, type DeleteEvalRunResponse, type DeleteEvalRunResponses, type DeleteFileData, type DeleteFileResponse, type DeleteFileResponse2, type DeleteFileResponses, type DeleteFineTuningCheckpointPermissionData, type DeleteFineTuningCheckpointPermissionResponse, type DeleteFineTuningCheckpointPermissionResponse2, type DeleteFineTuningCheckpointPermissionResponses, type DeleteInviteData, type DeleteInviteResponse, type DeleteInviteResponses, type DeleteMessageData, type DeleteMessageResponse, type DeleteMessageResponse2, type DeleteMessageResponses, type DeleteModelData, type DeleteModelResponse, type DeleteModelResponse2, type DeleteModelResponses, type DeleteProjectApiKeyData, type DeleteProjectApiKeyError, type DeleteProjectApiKeyErrors, type DeleteProjectApiKeyResponse, type DeleteProjectApiKeyResponses, type DeleteProjectServiceAccountData, type DeleteProjectServiceAccountResponse, type DeleteProjectServiceAccountResponses, type DeleteProjectUserData, type DeleteProjectUserError, type DeleteProjectUserErrors, type DeleteProjectUserResponse, type DeleteProjectUserResponses, type DeleteResponseData, type DeleteResponseError, type DeleteResponseErrors, type DeleteResponseResponses, type DeleteThreadData, type DeleteThreadResponse, type DeleteThreadResponse2, type DeleteThreadResponses, type DeleteUserData, type DeleteUserResponse, type DeleteUserResponses, type DeleteVectorStoreData, type DeleteVectorStoreFileData, type DeleteVectorStoreFileResponse, type DeleteVectorStoreFileResponse2, type DeleteVectorStoreFileResponses, type DeleteVectorStoreResponse, type DeleteVectorStoreResponse2, type DeleteVectorStoreResponses, type DoneEvent, type DoubleClick, type DownloadFileData, type DownloadFileResponse, type DownloadFileResponses, type Drag, type EasyInputMessage, type Embedding, type Error, type ErrorEvent, type ErrorResponse, type Eval, type EvalApiError, type EvalCustomDataSourceConfig, type EvalGraderLabelModel, type EvalGraderPython, type EvalGraderScoreModel, type EvalGraderStringCheck, type EvalGraderTextSimilarity, type EvalItem, type EvalJsonlFileContentSource, type EvalJsonlFileIdSource, type EvalList, type EvalLogsDataSourceConfig, type EvalResponsesSource, type EvalRun, type EvalRunList, type EvalRunOutputItem, type EvalRunOutputItemList, type EvalStoredCompletionsDataSourceConfig, type EvalStoredCompletionsSource, type FileCitationBody, type FileExpirationAfter, type FilePath, FilePurpose, FileSearchRanker, type FileSearchRankingOptions, type FileSearchTool, type FileSearchToolCall, type Filters, type FineTuneChatCompletionRequestAssistantMessage, type FineTuneChatRequestInput, type FineTuneDpoHyperparameters, type FineTuneDpoMethod, type FineTuneMethod, type FineTunePreferenceRequestInput, type FineTuneReinforcementHyperparameters, type FineTuneReinforcementMethod, type FineTuneReinforcementRequestInput, type FineTuneSupervisedHyperparameters, type FineTuneSupervisedMethod, type FineTuningCheckpointPermission, type FineTuningIntegration, type FineTuningJob, type FineTuningJobCheckpoint, type FineTuningJobEvent, type FunctionCallOutputItemParam, type FunctionObject, type FunctionParameters, type FunctionTool, type FunctionToolCall, type FunctionToolCallOutput, type FunctionToolCallOutputResource, type FunctionToolCallResource, type GetAssistantData, type GetAssistantResponse, type GetAssistantResponses, type GetCertificateData, type GetCertificateResponse, type GetCertificateResponses, type GetChatCompletionData, type GetChatCompletionMessagesData, type GetChatCompletionMessagesResponse, type GetChatCompletionMessagesResponses, type GetChatCompletionResponse, type GetChatCompletionResponses, type GetEvalData, type GetEvalResponse, type GetEvalResponses, type GetEvalRunData, type GetEvalRunOutputItemData, type GetEvalRunOutputItemResponse, type GetEvalRunOutputItemResponses, type GetEvalRunOutputItemsData, type GetEvalRunOutputItemsResponse, type GetEvalRunOutputItemsResponses, type GetEvalRunResponse, type GetEvalRunResponses, type GetEvalRunsData, type GetEvalRunsResponse, type GetEvalRunsResponses, type GetMessageData, type GetMessageResponse, type GetMessageResponses, type GetResponseData, type GetResponseResponse, type GetResponseResponses, type GetRunData, type GetRunResponse, type GetRunResponses, type GetRunStepData, type GetRunStepResponse, type GetRunStepResponses, type GetThreadData, type GetThreadResponse, type GetThreadResponses, type GetVectorStoreData, type GetVectorStoreFileBatchData, type GetVectorStoreFileBatchResponse, type GetVectorStoreFileBatchResponses, type GetVectorStoreFileData, type GetVectorStoreFileResponse, type GetVectorStoreFileResponses, type GetVectorStoreResponse, type GetVectorStoreResponses, type GraderLabelModel, type GraderMulti, type GraderPython, type GraderScoreModel, type GraderStringCheck, type GraderTextSimilarity, type Image, type ImageEditCompletedEvent, type ImageEditPartialImageEvent, type ImageEditStreamEvent, type ImageGenCompletedEvent, type ImageGenInputUsageDetails, type ImageGenPartialImageEvent, type ImageGenStreamEvent, type ImageGenTool, type ImageGenToolCall, type ImageGenUsage, ImageInputFidelity, type ImagesResponse, type ImagesUsage, Includable, type InputAudio, type InputContent, type InputFileContent, type InputImageContent, type InputItem, type InputMessage, type InputMessageContentList, type InputMessageResource, type InputTextContent, type Invite, type InviteDeleteResponse, type InviteListResponse, type InviteRequest, type InviteUserData, type InviteUserResponse, type InviteUserResponses, type Item, type ItemReferenceParam, type ItemResource, type KeyPress, type ListAssistantsData, type ListAssistantsResponse, type ListAssistantsResponse2, type ListAssistantsResponses, type ListAuditLogsData, type ListAuditLogsResponse, type ListAuditLogsResponse2, type ListAuditLogsResponses, type ListBatchesData, type ListBatchesResponse, type ListBatchesResponse2, type ListBatchesResponses, type ListCertificatesResponse, type ListChatCompletionsData, type ListChatCompletionsResponse, type ListChatCompletionsResponses, type ListContainerFilesData, type ListContainerFilesResponse, type ListContainerFilesResponses, type ListContainersData, type ListContainersResponse, type ListContainersResponses, type ListEvalsData, type ListEvalsResponse, type ListEvalsResponses, type ListFilesData, type ListFilesInVectorStoreBatchData, type ListFilesInVectorStoreBatchResponse, type ListFilesInVectorStoreBatchResponses, type ListFilesResponse, type ListFilesResponse2, type ListFilesResponses, type ListFineTuningCheckpointPermissionResponse, type ListFineTuningCheckpointPermissionsData, type ListFineTuningCheckpointPermissionsResponse, type ListFineTuningCheckpointPermissionsResponses, type ListFineTuningEventsData, type ListFineTuningEventsResponse, type ListFineTuningEventsResponses, type ListFineTuningJobCheckpointsData, type ListFineTuningJobCheckpointsResponse, type ListFineTuningJobCheckpointsResponse2, type ListFineTuningJobCheckpointsResponses, type ListFineTuningJobEventsResponse, type ListInputItemsData, type ListInputItemsResponse, type ListInputItemsResponses, type ListInvitesData, type ListInvitesResponse, type ListInvitesResponses, type ListMessagesData, type ListMessagesResponse, type ListMessagesResponse2, type ListMessagesResponses, type ListModelsData, type ListModelsResponse, type ListModelsResponse2, type ListModelsResponses, type ListOrganizationCertificatesData, type ListOrganizationCertificatesResponse, type ListOrganizationCertificatesResponses, type ListPaginatedFineTuningJobsData, type ListPaginatedFineTuningJobsResponse, type ListPaginatedFineTuningJobsResponse2, type ListPaginatedFineTuningJobsResponses, type ListProjectApiKeysData, type ListProjectApiKeysResponse, type ListProjectApiKeysResponses, type ListProjectCertificatesData, type ListProjectCertificatesResponse, type ListProjectCertificatesResponses, type ListProjectRateLimitsData, type ListProjectRateLimitsResponse, type ListProjectRateLimitsResponses, type ListProjectsData, type ListProjectServiceAccountsData, type ListProjectServiceAccountsError, type ListProjectServiceAccountsErrors, type ListProjectServiceAccountsResponse, type ListProjectServiceAccountsResponses, type ListProjectsResponse, type ListProjectsResponses, type ListProjectUsersData, type ListProjectUsersError, type ListProjectUsersErrors, type ListProjectUsersResponse, type ListProjectUsersResponses, type ListRunsData, type ListRunsResponse, type ListRunsResponse2, type ListRunsResponses, type ListRunStepsData, type ListRunStepsResponse, type ListRunStepsResponse2, type ListRunStepsResponses, type ListUsersData, type ListUsersResponse, type ListUsersResponses, type ListVectorStoreFilesData, type ListVectorStoreFilesResponse, type ListVectorStoreFilesResponse2, type ListVectorStoreFilesResponses, type ListVectorStoresData, type ListVectorStoresResponse, type ListVectorStoresResponse2, type ListVectorStoresResponses, type LocalShellExecAction, type LocalShellTool, type LocalShellToolCall, type LocalShellToolCallOutput, type LogProb, type LogProbProperties, type McpApprovalRequest, type McpApprovalResponse, type McpApprovalResponseResource, type McpListTools, type McpListToolsTool, type McpTool, type McpToolCall, type MessageContent, type MessageContentDelta, type MessageContentImageFileObject, type MessageContentImageUrlObject, type MessageContentRefusalObject, type MessageContentTextAnnotationsFileCitationObject, type MessageContentTextAnnotationsFilePathObject, type MessageContentTextObject, type MessageDeltaContentImageFileObject, type MessageDeltaContentImageUrlObject, type MessageDeltaContentRefusalObject, type MessageDeltaContentTextAnnotationsFileCitationObject, type MessageDeltaContentTextAnnotationsFilePathObject, type MessageDeltaContentTextObject, type MessageDeltaObject, type MessageObject, type MessageRequestContentTextObject, type MessageStreamEvent, type Metadata, type Model, type ModelIds, type ModelIdsResponses, type ModelIdsShared, type ModelResponseProperties, type ModerationImageUrlInput, type ModerationTextInput, type ModifyAssistantData, type ModifyAssistantRequest, type ModifyAssistantResponse, type ModifyAssistantResponses, type ModifyCertificateData, type ModifyCertificateRequest, type ModifyCertificateResponse, type ModifyCertificateResponses, type ModifyMessageData, type ModifyMessageRequest, type ModifyMessageResponse, type ModifyMessageResponses, type ModifyProjectData, type ModifyProjectError, type ModifyProjectErrors, type ModifyProjectResponse, type ModifyProjectResponses, type ModifyProjectUserData, type ModifyProjectUserError, type ModifyProjectUserErrors, type ModifyProjectUserResponse, type ModifyProjectUserResponses, type ModifyRunData, type ModifyRunRequest, type ModifyRunResponse, type ModifyRunResponses, type ModifyThreadData, type ModifyThreadRequest, type ModifyThreadResponse, type ModifyThreadResponses, type ModifyUserData, type ModifyUserResponse, type ModifyUserResponses, type ModifyVectorStoreData, type ModifyVectorStoreResponse, type ModifyVectorStoreResponses, type Move, type OpenAiFile, type OtherChunkingStrategyResponseParam, type OutputAudio, type OutputContent, type OutputItem, type OutputMessage, type OutputTextContent, type ParallelToolCalls, type PartialImages, type PauseFineTuningJobData, type PauseFineTuningJobResponse, type PauseFineTuningJobResponses, type PostBatchCancelledWebhookPayload, type PostBatchCancelledWebhookRequest, type PostBatchCompletedWebhookPayload, type PostBatchCompletedWebhookRequest, type PostBatchExpiredWebhookPayload, type PostBatchExpiredWebhookRequest, type PostBatchFailedWebhookPayload, type PostBatchFailedWebhookRequest, type PostEvalRunCanceledWebhookPayload, type PostEvalRunCanceledWebhookRequest, type PostEvalRunFailedWebhookPayload, type PostEvalRunFailedWebhookRequest, type PostEvalRunSucceededWebhookPayload, type PostEvalRunSucceededWebhookRequest, type PostFineTuningJobCancelledWebhookPayload, type PostFineTuningJobCancelledWebhookRequest, type PostFineTuningJobFailedWebhookPayload, type PostFineTuningJobFailedWebhookRequest, type PostFineTuningJobSucceededWebhookPayload, type PostFineTuningJobSucceededWebhookRequest, type PostResponseCancelledWebhookPayload, type PostResponseCancelledWebhookRequest, type PostResponseCompletedWebhookPayload, type PostResponseCompletedWebhookRequest, type PostResponseFailedWebhookPayload, type PostResponseFailedWebhookRequest, type PostResponseIncompleteWebhookPayload, type PostResponseIncompleteWebhookRequest, type PredictionContent, type Project, type ProjectApiKey, type ProjectApiKeyDeleteResponse, type ProjectApiKeyListResponse, type ProjectCreateRequest, type ProjectListResponse, type ProjectRateLimit, type ProjectRateLimitListResponse, type ProjectRateLimitUpdateRequest, type ProjectServiceAccount, type ProjectServiceAccountApiKey, type ProjectServiceAccountCreateRequest, type ProjectServiceAccountCreateResponse, type ProjectServiceAccountDeleteResponse, type ProjectServiceAccountListResponse, type ProjectUpdateRequest, type ProjectUser, type ProjectUserCreateRequest, type ProjectUserDeleteResponse, type ProjectUserListResponse, type ProjectUserUpdateRequest, type Prompt, type RankingOptions, type RealtimeClientEvent, type RealtimeClientEventConversationItemCreate, type RealtimeClientEventConversationItemDelete, type RealtimeClientEventConversationItemRetrieve, type RealtimeClientEventConversationItemTruncate, type RealtimeClientEventInputAudioBufferAppend, type RealtimeClientEventInputAudioBufferClear, type RealtimeClientEventInputAudioBufferCommit, type RealtimeClientEventOutputAudioBufferClear, type RealtimeClientEventResponseCancel, type RealtimeClientEventResponseCreate, type RealtimeClientEventSessionUpdate, type RealtimeClientEventTranscriptionSessionUpdate, type RealtimeConnectParams, type RealtimeConversationItem, type RealtimeConversationItemContent, type RealtimeConversationItemWithReference, type RealtimeResponse, type RealtimeResponseCreateParams, type RealtimeServerEvent, type RealtimeServerEventConversationCreated, type RealtimeServerEventConversationItemCreated, type RealtimeServerEventConversationItemDeleted, type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, type RealtimeServerEventConversationItemInputAudioTranscriptionDelta, type RealtimeServerEventConversationItemInputAudioTranscriptionFailed, type RealtimeServerEventConversationItemRetrieved, type RealtimeServerEventConversationItemTruncated, type RealtimeServerEventError, type RealtimeServerEventInputAudioBufferCleared, type RealtimeServerEventInputAudioBufferCommitted, type RealtimeServerEventInputAudioBufferSpeechStarted, type RealtimeServerEventInputAudioBufferSpeechStopped, type RealtimeServerEventOutputAudioBufferCleared, type RealtimeServerEventOutputAudioBufferStarted, type RealtimeServerEventOutputAudioBufferStopped, type RealtimeServerEventRateLimitsUpdated, type RealtimeServerEventResponseAudioDelta, type RealtimeServerEventResponseAudioDone, type RealtimeServerEventResponseAudioTranscriptDelta, type RealtimeServerEventResponseAudioTranscriptDone, type RealtimeServerEventResponseContentPartAdded, type RealtimeServerEventResponseContentPartDone, type RealtimeServerEventResponseCreated, type RealtimeServerEventResponseDone, type RealtimeServerEventResponseFunctionCallArgumentsDelta, type RealtimeServerEventResponseFunctionCallArgumentsDone, type RealtimeServerEventResponseOutputItemAdded, type RealtimeServerEventResponseOutputItemDone, type RealtimeServerEventResponseTextDelta, type RealtimeServerEventResponseTextDone, type RealtimeServerEventSessionCreated, type RealtimeServerEventSessionUpdated, type RealtimeServerEventTranscriptionSessionUpdated, type RealtimeSession, type RealtimeSessionCreateRequest, type RealtimeSessionCreateResponse, type RealtimeTranscriptionSessionCreateRequest, type RealtimeTranscriptionSessionCreateResponse, type Reasoning, ReasoningEffort, type ReasoningItem, type RefusalContent, type Response, type ResponseAudioDeltaEvent, type ResponseAudioDoneEvent, type ResponseAudioTranscriptDeltaEvent, type ResponseAudioTranscriptDoneEvent, type ResponseCodeInterpreterCallCodeDeltaEvent, type ResponseCodeInterpreterCallCodeDoneEvent, type ResponseCodeInterpreterCallCompletedEvent, type ResponseCodeInterpreterCallInProgressEvent, type ResponseCodeInterpreterCallInterpretingEvent, type ResponseCompletedEvent, type ResponseContentPartAddedEvent, type ResponseContentPartDoneEvent, type ResponseCreatedEvent, type ResponseCustomToolCallInputDeltaEvent, type ResponseCustomToolCallInputDoneEvent, type ResponseError, ResponseErrorCode, type ResponseErrorEvent, type ResponseFailedEvent, type ResponseFileSearchCallCompletedEvent, type ResponseFileSearchCallInProgressEvent, type ResponseFileSearchCallSearchingEvent, type ResponseFormatJsonObject, type ResponseFormatJsonSchema, type ResponseFormatJsonSchemaSchema, type ResponseFormatText, type ResponseFormatTextGrammar, type ResponseFormatTextPython, type ResponseFunctionCallArgumentsDeltaEvent, type ResponseFunctionCallArgumentsDoneEvent, type ResponseImageGenCallCompletedEvent, type ResponseImageGenCallGeneratingEvent, type ResponseImageGenCallInProgressEvent, type ResponseImageGenCallPartialImageEvent, type ResponseIncompleteEvent, type ResponseInProgressEvent, type ResponseItemList, type ResponseLogProb, type ResponseMcpCallArgumentsDeltaEvent, type ResponseMcpCallArgumentsDoneEvent, type ResponseMcpCallCompletedEvent, type ResponseMcpCallFailedEvent, type ResponseMcpCallInProgressEvent, type ResponseMcpListToolsCompletedEvent, type ResponseMcpListToolsFailedEvent, type ResponseMcpListToolsInProgressEvent, type ResponseModalities, type ResponseOutputItemAddedEvent, type ResponseOutputItemDoneEvent, type ResponseOutputTextAnnotationAddedEvent, type ResponsePromptVariables, type ResponseProperties, type ResponseQueuedEvent, type ResponseReasoningSummaryPartAddedEvent, type ResponseReasoningSummaryPartDoneEvent, type ResponseReasoningSummaryTextDeltaEvent, type ResponseReasoningSummaryTextDoneEvent, type ResponseReasoningTextDeltaEvent, type ResponseReasoningTextDoneEvent, type ResponseRefusalDeltaEvent, type ResponseRefusalDoneEvent, type ResponseStreamEvent, type ResponseStreamOptions, type ResponseTextDeltaEvent, type ResponseTextDoneEvent, type ResponseUsage, type ResponseWebSearchCallCompletedEvent, type ResponseWebSearchCallInProgressEvent, type ResponseWebSearchCallSearchingEvent, type ResumeFineTuningJobData, type ResumeFineTuningJobResponse, type ResumeFineTuningJobResponses, type RetrieveBatchData, type RetrieveBatchResponse, type RetrieveBatchResponses, type RetrieveContainerData, type RetrieveContainerFileContentData, type RetrieveContainerFileContentResponses, type RetrieveContainerFileData, type RetrieveContainerFileResponse, type RetrieveContainerFileResponses, type RetrieveContainerResponse, type RetrieveContainerResponses, type RetrieveFileData, type RetrieveFileResponse, type RetrieveFileResponses, type RetrieveFineTuningJobData, type RetrieveFineTuningJobResponse, type RetrieveFineTuningJobResponses, type RetrieveInviteData, type RetrieveInviteResponse, type RetrieveInviteResponses, type RetrieveModelData, type RetrieveModelResponse, type RetrieveModelResponses, type RetrieveProjectApiKeyData, type RetrieveProjectApiKeyResponse, type RetrieveProjectApiKeyResponses, type RetrieveProjectData, type RetrieveProjectResponse, type RetrieveProjectResponses, type RetrieveProjectServiceAccountData, type RetrieveProjectServiceAccountResponse, type RetrieveProjectServiceAccountResponses, type RetrieveProjectUserData, type RetrieveProjectUserResponse, type RetrieveProjectUserResponses, type RetrieveUserData, type RetrieveUserResponse, type RetrieveUserResponses, type RetrieveVectorStoreFileContentData, type RetrieveVectorStoreFileContentResponse, type RetrieveVectorStoreFileContentResponses, type RunCompletionUsage, type RunGraderData, type RunGraderRequest, type RunGraderResponse, type RunGraderResponse2, type RunGraderResponses, type RunObject, RunStatus, type RunStepCompletionUsage, type RunStepDeltaObject, type RunStepDeltaObjectDelta, type RunStepDeltaStepDetailsMessageCreationObject, type RunStepDeltaStepDetailsToolCall, type RunStepDeltaStepDetailsToolCallsCodeObject, type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject, type RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject, type RunStepDeltaStepDetailsToolCallsFileSearchObject, type RunStepDeltaStepDetailsToolCallsFunctionObject, type RunStepDeltaStepDetailsToolCallsObject, type RunStepDetailsMessageCreationObject, type RunStepDetailsToolCall, type RunStepDetailsToolCallsCodeObject, type RunStepDetailsToolCallsCodeOutputImageObject, type RunStepDetailsToolCallsCodeOutputLogsObject, type RunStepDetailsToolCallsFileSearchObject, type RunStepDetailsToolCallsFileSearchRankingOptionsObject, type RunStepDetailsToolCallsFileSearchResultObject, type RunStepDetailsToolCallsFunctionObject, type RunStepDetailsToolCallsObject, type RunStepObject, type RunStepStreamEvent, type RunStreamEvent, type RunToolCallObject, type Screenshot, type Scroll, type SearchVectorStoreData, type SearchVectorStoreResponse, type SearchVectorStoreResponses, ServiceTier, type SpeechAudioDeltaEvent, type SpeechAudioDoneEvent, type StaticChunkingStrategy, type StaticChunkingStrategyRequestParam, type StaticChunkingStrategyResponseParam, type StopConfiguration, type SubmitToolOuputsToRunData, type SubmitToolOuputsToRunResponse, type SubmitToolOuputsToRunResponses, type SubmitToolOutputsRunRequest, type SubmitToolOutputsRunRequestWithoutStream, type TextAnnotation, type TextAnnotationDelta, type TextResponseFormatConfiguration, type TextResponseFormatJsonSchema, type ThreadObject, type ThreadStreamEvent, type ToggleCertificatesRequest, type Tool, type ToolChoiceAllowed, type ToolChoiceCustom, type ToolChoiceFunction, type ToolChoiceMcp, ToolChoiceOptions, type ToolChoiceTypes, type TopLogProb, type TranscriptionChunkingStrategy, TranscriptionInclude, type TranscriptionSegment, type TranscriptionWord, type TranscriptTextDeltaEvent, type TranscriptTextDoneEvent, type TranscriptTextUsageDuration, type TranscriptTextUsageTokens, type TruncationObject, type Type, type UpdateChatCompletionData, type UpdateChatCompletionResponse, type UpdateChatCompletionResponses, type UpdateEvalData, type UpdateEvalResponse, type UpdateEvalResponses, type UpdateProjectRateLimitsData, type UpdateProjectRateLimitsError, type UpdateProjectRateLimitsErrors, type UpdateProjectRateLimitsResponse, type UpdateProjectRateLimitsResponses, type UpdateVectorStoreFileAttributesData, type UpdateVectorStoreFileAttributesRequest, type UpdateVectorStoreFileAttributesResponse, type UpdateVectorStoreFileAttributesResponses, type UpdateVectorStoreRequest, type Upload, type UploadCertificateData, type UploadCertificateRequest, type UploadCertificateResponse, type UploadCertificateResponses, type UploadPart, type UrlCitationBody, type UsageAudioSpeechesData, type UsageAudioSpeechesResponse, type UsageAudioSpeechesResponses, type UsageAudioSpeechesResult, type UsageAudioTranscriptionsData, type UsageAudioTranscriptionsResponse, type UsageAudioTranscriptionsResponses, type UsageAudioTranscriptionsResult, type UsageCodeInterpreterSessionsData, type UsageCodeInterpreterSessionsResponse, type UsageCodeInterpreterSessionsResponses, type UsageCodeInterpreterSessionsResult, type UsageCompletionsData, type UsageCompletionsResponse, type UsageCompletionsResponses, type UsageCompletionsResult, type UsageCostsData, type UsageCostsResponse, type UsageCostsResponses, type UsageEmbeddingsData, type UsageEmbeddingsResponse, type UsageEmbeddingsResponses, type UsageEmbeddingsResult, type UsageImagesData, type UsageImagesResponse, type UsageImagesResponses, type UsageImagesResult, type UsageModerationsData, type UsageModerationsResponse, type UsageModerationsResponses, type UsageModerationsResult, type UsageResponse, type UsageTimeBucket, type UsageVectorStoresData, type UsageVectorStoresResponse, type UsageVectorStoresResponses, type UsageVectorStoresResult, type User, type UserDeleteResponse, type UserListResponse, type UserRoleUpdateRequest, type VadConfig, type ValidateGraderData, type ValidateGraderRequest, type ValidateGraderResponse, type ValidateGraderResponse2, type ValidateGraderResponses, type VectorStoreExpirationAfter, type VectorStoreFileAttributes, type VectorStoreFileBatchObject, type VectorStoreFileContentResponse, type VectorStoreFileObject, type VectorStoreObject, type VectorStoreSearchRequest, type VectorStoreSearchResultContentObject, type VectorStoreSearchResultItem, type VectorStoreSearchResultsPage, Verbosity, type VoiceIdsShared, type Wait, type WebhookBatchCancelled, type WebhookBatchCompleted, type WebhookBatchExpired, type WebhookBatchFailed, type WebhookEvalRunCanceled, type WebhookEvalRunFailed, type WebhookEvalRunSucceeded, type WebhookFineTuningJobCancelled, type WebhookFineTuningJobFailed, type WebhookFineTuningJobSucceeded, type WebhookResponseCancelled, type WebhookResponseCompleted, type WebhookResponseFailed, type WebhookResponseIncomplete, type Webhooks, type WebSearchActionFind, type WebSearchActionOpenPage, type WebSearchActionSearch, WebSearchContextSize, type WebSearchLocation, type WebSearchPreviewTool, type WebSearchToolCall } from './types.gen'; +export { + type ActivateOrganizationCertificatesData, + type ActivateOrganizationCertificatesResponse, + type ActivateOrganizationCertificatesResponses, + type ActivateProjectCertificatesData, + type ActivateProjectCertificatesResponse, + type ActivateProjectCertificatesResponses, + type AddUploadPartData, + type AddUploadPartRequest, + type AddUploadPartResponse, + type AddUploadPartResponses, + type AdminApiKey, + type AdminApiKeysCreateData, + type AdminApiKeysCreateResponse, + type AdminApiKeysCreateResponses, + type AdminApiKeysDeleteData, + type AdminApiKeysDeleteResponse, + type AdminApiKeysDeleteResponses, + type AdminApiKeysGetData, + type AdminApiKeysGetResponse, + type AdminApiKeysGetResponses, + type AdminApiKeysListData, + type AdminApiKeysListResponse, + type AdminApiKeysListResponses, + type Annotation, + type ApiKeyList, + type ApproximateLocation, + type ArchiveProjectData, + type ArchiveProjectResponse, + type ArchiveProjectResponses, + type AssistantObject, + type AssistantsApiResponseFormatOption, + type AssistantsApiToolChoiceOption, + type AssistantsNamedToolChoice, + type AssistantStreamEvent, + AssistantSupportedModels, + type AssistantTool, + type AssistantToolsCode, + type AssistantToolsFileSearch, + type AssistantToolsFileSearchTypeOnly, + type AssistantToolsFunction, + AudioResponseFormat, + type AuditLog, + type AuditLogActor, + type AuditLogActorApiKey, + type AuditLogActorServiceAccount, + type AuditLogActorSession, + type AuditLogActorUser, + AuditLogEventType, + type AutoChunkingStrategyRequestParam, + type Batch, + type BatchError, + type BatchFileExpirationAfter, + type BatchRequestCounts, + type BatchRequestInput, + type BatchRequestOutput, + type CancelBatchData, + type CancelBatchResponse, + type CancelBatchResponses, + type CancelEvalRunData, + type CancelEvalRunResponse, + type CancelEvalRunResponses, + type CancelFineTuningJobData, + type CancelFineTuningJobResponse, + type CancelFineTuningJobResponses, + type CancelResponseData, + type CancelResponseError, + type CancelResponseErrors, + type CancelResponseResponse, + type CancelResponseResponses, + type CancelRunData, + type CancelRunResponse, + type CancelRunResponses, + type CancelUploadData, + type CancelUploadResponse, + type CancelUploadResponses, + type CancelVectorStoreFileBatchData, + type CancelVectorStoreFileBatchResponse, + type CancelVectorStoreFileBatchResponses, + type Certificate, + type ChatCompletionAllowedTools, + type ChatCompletionAllowedToolsChoice, + type ChatCompletionDeleted, + type ChatCompletionFunctionCallOption, + type ChatCompletionFunctions, + type ChatCompletionList, + type ChatCompletionMessageCustomToolCall, + type ChatCompletionMessageList, + type ChatCompletionMessageToolCall, + type ChatCompletionMessageToolCallChunk, + type ChatCompletionMessageToolCalls, + type ChatCompletionModalities, + type ChatCompletionNamedToolChoice, + type ChatCompletionNamedToolChoiceCustom, + type ChatCompletionRequestAssistantMessage, + type ChatCompletionRequestAssistantMessageContentPart, + type ChatCompletionRequestDeveloperMessage, + type ChatCompletionRequestFunctionMessage, + type ChatCompletionRequestMessage, + type ChatCompletionRequestMessageContentPartAudio, + type ChatCompletionRequestMessageContentPartFile, + type ChatCompletionRequestMessageContentPartImage, + type ChatCompletionRequestMessageContentPartRefusal, + type ChatCompletionRequestMessageContentPartText, + type ChatCompletionRequestSystemMessage, + type ChatCompletionRequestSystemMessageContentPart, + type ChatCompletionRequestToolMessage, + type ChatCompletionRequestToolMessageContentPart, + type ChatCompletionRequestUserMessage, + type ChatCompletionRequestUserMessageContentPart, + type ChatCompletionResponseMessage, + ChatCompletionRole, + type ChatCompletionStreamOptions, + type ChatCompletionStreamResponseDelta, + type ChatCompletionTokenLogprob, + type ChatCompletionTool, + type ChatCompletionToolChoiceOption, + ChatModel, + type ChunkingStrategyRequestParam, + type ChunkingStrategyResponse, + type Click, + type ClientOptions, + type CodeInterpreterFileOutput, + type CodeInterpreterOutputImage, + type CodeInterpreterOutputLogs, + type CodeInterpreterTextOutput, + type CodeInterpreterTool, + type CodeInterpreterToolAuto, + type CodeInterpreterToolCall, + type ComparisonFilter, + type CompleteUploadData, + type CompleteUploadRequest, + type CompleteUploadResponse, + type CompleteUploadResponses, + type CompletionUsage, + type CompoundFilter, + type ComputerAction, + type ComputerCallOutputItemParam, + type ComputerCallSafetyCheckParam, + type ComputerScreenshotImage, + type ComputerToolCall, + type ComputerToolCallOutput, + type ComputerToolCallOutputResource, + type ComputerToolCallSafetyCheck, + type ComputerUsePreviewTool, + type ContainerFileCitationBody, + type ContainerFileListResource, + type ContainerFileResource, + type ContainerListResource, + type ContainerResource, + type Content, + type Coordinate, + type CostsResult, + type CreateAssistantData, + type CreateAssistantRequest, + type CreateAssistantResponse, + type CreateAssistantResponses, + type CreateBatchData, + type CreateBatchResponse, + type CreateBatchResponses, + type CreateChatCompletionData, + type CreateChatCompletionRequest, + type CreateChatCompletionResponse, + type CreateChatCompletionResponse2, + type CreateChatCompletionResponses, + type CreateChatCompletionStreamResponse, + type CreateCompletionData, + type CreateCompletionRequest, + type CreateCompletionResponse, + type CreateCompletionResponse2, + type CreateCompletionResponses, + type CreateContainerBody, + type CreateContainerData, + type CreateContainerFileBody, + type CreateContainerFileData, + type CreateContainerFileResponse, + type CreateContainerFileResponses, + type CreateContainerResponse, + type CreateContainerResponses, + type CreateEmbeddingData, + type CreateEmbeddingRequest, + type CreateEmbeddingResponse, + type CreateEmbeddingResponse2, + type CreateEmbeddingResponses, + type CreateEvalCompletionsRunDataSource, + type CreateEvalCustomDataSourceConfig, + type CreateEvalData, + type CreateEvalItem, + type CreateEvalJsonlRunDataSource, + type CreateEvalLabelModelGrader, + type CreateEvalLogsDataSourceConfig, + type CreateEvalRequest, + type CreateEvalResponse, + type CreateEvalResponses, + type CreateEvalResponsesRunDataSource, + type CreateEvalRunData, + type CreateEvalRunError, + type CreateEvalRunErrors, + type CreateEvalRunRequest, + type CreateEvalRunResponse, + type CreateEvalRunResponses, + type CreateEvalStoredCompletionsDataSourceConfig, + type CreateFileData, + type CreateFileRequest, + type CreateFileResponse, + type CreateFileResponses, + type CreateFineTuningCheckpointPermissionData, + type CreateFineTuningCheckpointPermissionRequest, + type CreateFineTuningCheckpointPermissionResponse, + type CreateFineTuningCheckpointPermissionResponses, + type CreateFineTuningJobData, + type CreateFineTuningJobRequest, + type CreateFineTuningJobResponse, + type CreateFineTuningJobResponses, + type CreateImageData, + type CreateImageEditData, + type CreateImageEditRequest, + type CreateImageEditResponse, + type CreateImageEditResponses, + type CreateImageRequest, + type CreateImageResponse, + type CreateImageResponses, + type CreateImageVariationData, + type CreateImageVariationRequest, + type CreateImageVariationResponse, + type CreateImageVariationResponses, + type CreateMessageData, + type CreateMessageRequest, + type CreateMessageResponse, + type CreateMessageResponses, + type CreateModelResponseProperties, + type CreateModerationData, + type CreateModerationRequest, + type CreateModerationResponse, + type CreateModerationResponse2, + type CreateModerationResponses, + type CreateProjectData, + type CreateProjectResponse, + type CreateProjectResponses, + type CreateProjectServiceAccountData, + type CreateProjectServiceAccountError, + type CreateProjectServiceAccountErrors, + type CreateProjectServiceAccountResponse, + type CreateProjectServiceAccountResponses, + type CreateProjectUserData, + type CreateProjectUserError, + type CreateProjectUserErrors, + type CreateProjectUserResponse, + type CreateProjectUserResponses, + type CreateRealtimeSessionData, + type CreateRealtimeSessionResponse, + type CreateRealtimeSessionResponses, + type CreateRealtimeTranscriptionSessionData, + type CreateRealtimeTranscriptionSessionResponse, + type CreateRealtimeTranscriptionSessionResponses, + type CreateResponse, + type CreateResponseData, + type CreateResponseResponse, + type CreateResponseResponses, + type CreateRunData, + type CreateRunRequest, + type CreateRunRequestWithoutStream, + type CreateRunResponse, + type CreateRunResponses, + type CreateSpeechData, + type CreateSpeechRequest, + type CreateSpeechResponse, + type CreateSpeechResponses, + type CreateSpeechResponseStreamEvent, + type CreateThreadAndRunData, + type CreateThreadAndRunRequest, + type CreateThreadAndRunRequestWithoutStream, + type CreateThreadAndRunResponse, + type CreateThreadAndRunResponses, + type CreateThreadData, + type CreateThreadRequest, + type CreateThreadResponse, + type CreateThreadResponses, + type CreateTranscriptionData, + type CreateTranscriptionRequest, + type CreateTranscriptionResponse, + type CreateTranscriptionResponseJson, + type CreateTranscriptionResponses, + type CreateTranscriptionResponseStreamEvent, + type CreateTranscriptionResponseVerboseJson, + type CreateTranslationData, + type CreateTranslationRequest, + type CreateTranslationResponse, + type CreateTranslationResponseJson, + type CreateTranslationResponses, + type CreateTranslationResponseVerboseJson, + type CreateUploadData, + type CreateUploadRequest, + type CreateUploadResponse, + type CreateUploadResponses, + type CreateVectorStoreData, + type CreateVectorStoreFileBatchData, + type CreateVectorStoreFileBatchRequest, + type CreateVectorStoreFileBatchResponse, + type CreateVectorStoreFileBatchResponses, + type CreateVectorStoreFileData, + type CreateVectorStoreFileRequest, + type CreateVectorStoreFileResponse, + type CreateVectorStoreFileResponses, + type CreateVectorStoreRequest, + type CreateVectorStoreResponse, + type CreateVectorStoreResponses, + type CustomTool, + type CustomToolCall, + type CustomToolCallOutput, + type CustomToolChatCompletions, + type DeactivateOrganizationCertificatesData, + type DeactivateOrganizationCertificatesResponse, + type DeactivateOrganizationCertificatesResponses, + type DeactivateProjectCertificatesData, + type DeactivateProjectCertificatesResponse, + type DeactivateProjectCertificatesResponses, + type DeleteAssistantData, + type DeleteAssistantResponse, + type DeleteAssistantResponse2, + type DeleteAssistantResponses, + type DeleteCertificateData, + type DeleteCertificateResponse, + type DeleteCertificateResponse2, + type DeleteCertificateResponses, + type DeleteChatCompletionData, + type DeleteChatCompletionResponse, + type DeleteChatCompletionResponses, + type DeleteContainerData, + type DeleteContainerFileData, + type DeleteContainerFileResponses, + type DeleteContainerResponses, + type DeleteEvalData, + type DeleteEvalError, + type DeleteEvalErrors, + type DeleteEvalResponse, + type DeleteEvalResponses, + type DeleteEvalRunData, + type DeleteEvalRunError, + type DeleteEvalRunErrors, + type DeleteEvalRunResponse, + type DeleteEvalRunResponses, + type DeleteFileData, + type DeleteFileResponse, + type DeleteFileResponse2, + type DeleteFileResponses, + type DeleteFineTuningCheckpointPermissionData, + type DeleteFineTuningCheckpointPermissionResponse, + type DeleteFineTuningCheckpointPermissionResponse2, + type DeleteFineTuningCheckpointPermissionResponses, + type DeleteInviteData, + type DeleteInviteResponse, + type DeleteInviteResponses, + type DeleteMessageData, + type DeleteMessageResponse, + type DeleteMessageResponse2, + type DeleteMessageResponses, + type DeleteModelData, + type DeleteModelResponse, + type DeleteModelResponse2, + type DeleteModelResponses, + type DeleteProjectApiKeyData, + type DeleteProjectApiKeyError, + type DeleteProjectApiKeyErrors, + type DeleteProjectApiKeyResponse, + type DeleteProjectApiKeyResponses, + type DeleteProjectServiceAccountData, + type DeleteProjectServiceAccountResponse, + type DeleteProjectServiceAccountResponses, + type DeleteProjectUserData, + type DeleteProjectUserError, + type DeleteProjectUserErrors, + type DeleteProjectUserResponse, + type DeleteProjectUserResponses, + type DeleteResponseData, + type DeleteResponseError, + type DeleteResponseErrors, + type DeleteResponseResponses, + type DeleteThreadData, + type DeleteThreadResponse, + type DeleteThreadResponse2, + type DeleteThreadResponses, + type DeleteUserData, + type DeleteUserResponse, + type DeleteUserResponses, + type DeleteVectorStoreData, + type DeleteVectorStoreFileData, + type DeleteVectorStoreFileResponse, + type DeleteVectorStoreFileResponse2, + type DeleteVectorStoreFileResponses, + type DeleteVectorStoreResponse, + type DeleteVectorStoreResponse2, + type DeleteVectorStoreResponses, + type DoneEvent, + type DoubleClick, + type DownloadFileData, + type DownloadFileResponse, + type DownloadFileResponses, + type Drag, + type EasyInputMessage, + type Embedding, + type Error, + type ErrorEvent, + type ErrorResponse, + type Eval, + type EvalApiError, + type EvalCustomDataSourceConfig, + type EvalGraderLabelModel, + type EvalGraderPython, + type EvalGraderScoreModel, + type EvalGraderStringCheck, + type EvalGraderTextSimilarity, + type EvalItem, + type EvalJsonlFileContentSource, + type EvalJsonlFileIdSource, + type EvalList, + type EvalLogsDataSourceConfig, + type EvalResponsesSource, + type EvalRun, + type EvalRunList, + type EvalRunOutputItem, + type EvalRunOutputItemList, + type EvalStoredCompletionsDataSourceConfig, + type EvalStoredCompletionsSource, + type FileCitationBody, + type FileExpirationAfter, + type FilePath, + FilePurpose, + FileSearchRanker, + type FileSearchRankingOptions, + type FileSearchTool, + type FileSearchToolCall, + type Filters, + type FineTuneChatCompletionRequestAssistantMessage, + type FineTuneChatRequestInput, + type FineTuneDpoHyperparameters, + type FineTuneDpoMethod, + type FineTuneMethod, + type FineTunePreferenceRequestInput, + type FineTuneReinforcementHyperparameters, + type FineTuneReinforcementMethod, + type FineTuneReinforcementRequestInput, + type FineTuneSupervisedHyperparameters, + type FineTuneSupervisedMethod, + type FineTuningCheckpointPermission, + type FineTuningIntegration, + type FineTuningJob, + type FineTuningJobCheckpoint, + type FineTuningJobEvent, + type FunctionCallOutputItemParam, + type FunctionObject, + type FunctionParameters, + type FunctionTool, + type FunctionToolCall, + type FunctionToolCallOutput, + type FunctionToolCallOutputResource, + type FunctionToolCallResource, + type GetAssistantData, + type GetAssistantResponse, + type GetAssistantResponses, + type GetCertificateData, + type GetCertificateResponse, + type GetCertificateResponses, + type GetChatCompletionData, + type GetChatCompletionMessagesData, + type GetChatCompletionMessagesResponse, + type GetChatCompletionMessagesResponses, + type GetChatCompletionResponse, + type GetChatCompletionResponses, + type GetEvalData, + type GetEvalResponse, + type GetEvalResponses, + type GetEvalRunData, + type GetEvalRunOutputItemData, + type GetEvalRunOutputItemResponse, + type GetEvalRunOutputItemResponses, + type GetEvalRunOutputItemsData, + type GetEvalRunOutputItemsResponse, + type GetEvalRunOutputItemsResponses, + type GetEvalRunResponse, + type GetEvalRunResponses, + type GetEvalRunsData, + type GetEvalRunsResponse, + type GetEvalRunsResponses, + type GetMessageData, + type GetMessageResponse, + type GetMessageResponses, + type GetResponseData, + type GetResponseResponse, + type GetResponseResponses, + type GetRunData, + type GetRunResponse, + type GetRunResponses, + type GetRunStepData, + type GetRunStepResponse, + type GetRunStepResponses, + type GetThreadData, + type GetThreadResponse, + type GetThreadResponses, + type GetVectorStoreData, + type GetVectorStoreFileBatchData, + type GetVectorStoreFileBatchResponse, + type GetVectorStoreFileBatchResponses, + type GetVectorStoreFileData, + type GetVectorStoreFileResponse, + type GetVectorStoreFileResponses, + type GetVectorStoreResponse, + type GetVectorStoreResponses, + type GraderLabelModel, + type GraderMulti, + type GraderPython, + type GraderScoreModel, + type GraderStringCheck, + type GraderTextSimilarity, + type Image, + type ImageEditCompletedEvent, + type ImageEditPartialImageEvent, + type ImageEditStreamEvent, + type ImageGenCompletedEvent, + type ImageGenInputUsageDetails, + type ImageGenPartialImageEvent, + type ImageGenStreamEvent, + type ImageGenTool, + type ImageGenToolCall, + type ImageGenUsage, + ImageInputFidelity, + type ImagesResponse, + type ImagesUsage, + Includable, + type InputAudio, + type InputContent, + type InputFileContent, + type InputImageContent, + type InputItem, + type InputMessage, + type InputMessageContentList, + type InputMessageResource, + type InputTextContent, + type Invite, + type InviteDeleteResponse, + type InviteListResponse, + type InviteRequest, + type InviteUserData, + type InviteUserResponse, + type InviteUserResponses, + type Item, + type ItemReferenceParam, + type ItemResource, + type KeyPress, + type ListAssistantsData, + type ListAssistantsResponse, + type ListAssistantsResponse2, + type ListAssistantsResponses, + type ListAuditLogsData, + type ListAuditLogsResponse, + type ListAuditLogsResponse2, + type ListAuditLogsResponses, + type ListBatchesData, + type ListBatchesResponse, + type ListBatchesResponse2, + type ListBatchesResponses, + type ListCertificatesResponse, + type ListChatCompletionsData, + type ListChatCompletionsResponse, + type ListChatCompletionsResponses, + type ListContainerFilesData, + type ListContainerFilesResponse, + type ListContainerFilesResponses, + type ListContainersData, + type ListContainersResponse, + type ListContainersResponses, + type ListEvalsData, + type ListEvalsResponse, + type ListEvalsResponses, + type ListFilesData, + type ListFilesInVectorStoreBatchData, + type ListFilesInVectorStoreBatchResponse, + type ListFilesInVectorStoreBatchResponses, + type ListFilesResponse, + type ListFilesResponse2, + type ListFilesResponses, + type ListFineTuningCheckpointPermissionResponse, + type ListFineTuningCheckpointPermissionsData, + type ListFineTuningCheckpointPermissionsResponse, + type ListFineTuningCheckpointPermissionsResponses, + type ListFineTuningEventsData, + type ListFineTuningEventsResponse, + type ListFineTuningEventsResponses, + type ListFineTuningJobCheckpointsData, + type ListFineTuningJobCheckpointsResponse, + type ListFineTuningJobCheckpointsResponse2, + type ListFineTuningJobCheckpointsResponses, + type ListFineTuningJobEventsResponse, + type ListInputItemsData, + type ListInputItemsResponse, + type ListInputItemsResponses, + type ListInvitesData, + type ListInvitesResponse, + type ListInvitesResponses, + type ListMessagesData, + type ListMessagesResponse, + type ListMessagesResponse2, + type ListMessagesResponses, + type ListModelsData, + type ListModelsResponse, + type ListModelsResponse2, + type ListModelsResponses, + type ListOrganizationCertificatesData, + type ListOrganizationCertificatesResponse, + type ListOrganizationCertificatesResponses, + type ListPaginatedFineTuningJobsData, + type ListPaginatedFineTuningJobsResponse, + type ListPaginatedFineTuningJobsResponse2, + type ListPaginatedFineTuningJobsResponses, + type ListProjectApiKeysData, + type ListProjectApiKeysResponse, + type ListProjectApiKeysResponses, + type ListProjectCertificatesData, + type ListProjectCertificatesResponse, + type ListProjectCertificatesResponses, + type ListProjectRateLimitsData, + type ListProjectRateLimitsResponse, + type ListProjectRateLimitsResponses, + type ListProjectsData, + type ListProjectServiceAccountsData, + type ListProjectServiceAccountsError, + type ListProjectServiceAccountsErrors, + type ListProjectServiceAccountsResponse, + type ListProjectServiceAccountsResponses, + type ListProjectsResponse, + type ListProjectsResponses, + type ListProjectUsersData, + type ListProjectUsersError, + type ListProjectUsersErrors, + type ListProjectUsersResponse, + type ListProjectUsersResponses, + type ListRunsData, + type ListRunsResponse, + type ListRunsResponse2, + type ListRunsResponses, + type ListRunStepsData, + type ListRunStepsResponse, + type ListRunStepsResponse2, + type ListRunStepsResponses, + type ListUsersData, + type ListUsersResponse, + type ListUsersResponses, + type ListVectorStoreFilesData, + type ListVectorStoreFilesResponse, + type ListVectorStoreFilesResponse2, + type ListVectorStoreFilesResponses, + type ListVectorStoresData, + type ListVectorStoresResponse, + type ListVectorStoresResponse2, + type ListVectorStoresResponses, + type LocalShellExecAction, + type LocalShellTool, + type LocalShellToolCall, + type LocalShellToolCallOutput, + type LogProb, + type LogProbProperties, + type McpApprovalRequest, + type McpApprovalResponse, + type McpApprovalResponseResource, + type McpListTools, + type McpListToolsTool, + type McpTool, + type McpToolCall, + type MessageContent, + type MessageContentDelta, + type MessageContentImageFileObject, + type MessageContentImageUrlObject, + type MessageContentRefusalObject, + type MessageContentTextAnnotationsFileCitationObject, + type MessageContentTextAnnotationsFilePathObject, + type MessageContentTextObject, + type MessageDeltaContentImageFileObject, + type MessageDeltaContentImageUrlObject, + type MessageDeltaContentRefusalObject, + type MessageDeltaContentTextAnnotationsFileCitationObject, + type MessageDeltaContentTextAnnotationsFilePathObject, + type MessageDeltaContentTextObject, + type MessageDeltaObject, + type MessageObject, + type MessageRequestContentTextObject, + type MessageStreamEvent, + type Metadata, + type Model, + type ModelIds, + type ModelIdsResponses, + type ModelIdsShared, + type ModelResponseProperties, + type ModerationImageUrlInput, + type ModerationTextInput, + type ModifyAssistantData, + type ModifyAssistantRequest, + type ModifyAssistantResponse, + type ModifyAssistantResponses, + type ModifyCertificateData, + type ModifyCertificateRequest, + type ModifyCertificateResponse, + type ModifyCertificateResponses, + type ModifyMessageData, + type ModifyMessageRequest, + type ModifyMessageResponse, + type ModifyMessageResponses, + type ModifyProjectData, + type ModifyProjectError, + type ModifyProjectErrors, + type ModifyProjectResponse, + type ModifyProjectResponses, + type ModifyProjectUserData, + type ModifyProjectUserError, + type ModifyProjectUserErrors, + type ModifyProjectUserResponse, + type ModifyProjectUserResponses, + type ModifyRunData, + type ModifyRunRequest, + type ModifyRunResponse, + type ModifyRunResponses, + type ModifyThreadData, + type ModifyThreadRequest, + type ModifyThreadResponse, + type ModifyThreadResponses, + type ModifyUserData, + type ModifyUserResponse, + type ModifyUserResponses, + type ModifyVectorStoreData, + type ModifyVectorStoreResponse, + type ModifyVectorStoreResponses, + type Move, + type OpenAiFile, + type OtherChunkingStrategyResponseParam, + type OutputAudio, + type OutputContent, + type OutputItem, + type OutputMessage, + type OutputTextContent, + type ParallelToolCalls, + type PartialImages, + type PauseFineTuningJobData, + type PauseFineTuningJobResponse, + type PauseFineTuningJobResponses, + type PostBatchCancelledWebhookPayload, + type PostBatchCancelledWebhookRequest, + type PostBatchCompletedWebhookPayload, + type PostBatchCompletedWebhookRequest, + type PostBatchExpiredWebhookPayload, + type PostBatchExpiredWebhookRequest, + type PostBatchFailedWebhookPayload, + type PostBatchFailedWebhookRequest, + type PostEvalRunCanceledWebhookPayload, + type PostEvalRunCanceledWebhookRequest, + type PostEvalRunFailedWebhookPayload, + type PostEvalRunFailedWebhookRequest, + type PostEvalRunSucceededWebhookPayload, + type PostEvalRunSucceededWebhookRequest, + type PostFineTuningJobCancelledWebhookPayload, + type PostFineTuningJobCancelledWebhookRequest, + type PostFineTuningJobFailedWebhookPayload, + type PostFineTuningJobFailedWebhookRequest, + type PostFineTuningJobSucceededWebhookPayload, + type PostFineTuningJobSucceededWebhookRequest, + type PostResponseCancelledWebhookPayload, + type PostResponseCancelledWebhookRequest, + type PostResponseCompletedWebhookPayload, + type PostResponseCompletedWebhookRequest, + type PostResponseFailedWebhookPayload, + type PostResponseFailedWebhookRequest, + type PostResponseIncompleteWebhookPayload, + type PostResponseIncompleteWebhookRequest, + type PredictionContent, + type Project, + type ProjectApiKey, + type ProjectApiKeyDeleteResponse, + type ProjectApiKeyListResponse, + type ProjectCreateRequest, + type ProjectListResponse, + type ProjectRateLimit, + type ProjectRateLimitListResponse, + type ProjectRateLimitUpdateRequest, + type ProjectServiceAccount, + type ProjectServiceAccountApiKey, + type ProjectServiceAccountCreateRequest, + type ProjectServiceAccountCreateResponse, + type ProjectServiceAccountDeleteResponse, + type ProjectServiceAccountListResponse, + type ProjectUpdateRequest, + type ProjectUser, + type ProjectUserCreateRequest, + type ProjectUserDeleteResponse, + type ProjectUserListResponse, + type ProjectUserUpdateRequest, + type Prompt, + type RankingOptions, + type RealtimeClientEvent, + type RealtimeClientEventConversationItemCreate, + type RealtimeClientEventConversationItemDelete, + type RealtimeClientEventConversationItemRetrieve, + type RealtimeClientEventConversationItemTruncate, + type RealtimeClientEventInputAudioBufferAppend, + type RealtimeClientEventInputAudioBufferClear, + type RealtimeClientEventInputAudioBufferCommit, + type RealtimeClientEventOutputAudioBufferClear, + type RealtimeClientEventResponseCancel, + type RealtimeClientEventResponseCreate, + type RealtimeClientEventSessionUpdate, + type RealtimeClientEventTranscriptionSessionUpdate, + type RealtimeConnectParams, + type RealtimeConversationItem, + type RealtimeConversationItemContent, + type RealtimeConversationItemWithReference, + type RealtimeResponse, + type RealtimeResponseCreateParams, + type RealtimeServerEvent, + type RealtimeServerEventConversationCreated, + type RealtimeServerEventConversationItemCreated, + type RealtimeServerEventConversationItemDeleted, + type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted, + type RealtimeServerEventConversationItemInputAudioTranscriptionDelta, + type RealtimeServerEventConversationItemInputAudioTranscriptionFailed, + type RealtimeServerEventConversationItemRetrieved, + type RealtimeServerEventConversationItemTruncated, + type RealtimeServerEventError, + type RealtimeServerEventInputAudioBufferCleared, + type RealtimeServerEventInputAudioBufferCommitted, + type RealtimeServerEventInputAudioBufferSpeechStarted, + type RealtimeServerEventInputAudioBufferSpeechStopped, + type RealtimeServerEventOutputAudioBufferCleared, + type RealtimeServerEventOutputAudioBufferStarted, + type RealtimeServerEventOutputAudioBufferStopped, + type RealtimeServerEventRateLimitsUpdated, + type RealtimeServerEventResponseAudioDelta, + type RealtimeServerEventResponseAudioDone, + type RealtimeServerEventResponseAudioTranscriptDelta, + type RealtimeServerEventResponseAudioTranscriptDone, + type RealtimeServerEventResponseContentPartAdded, + type RealtimeServerEventResponseContentPartDone, + type RealtimeServerEventResponseCreated, + type RealtimeServerEventResponseDone, + type RealtimeServerEventResponseFunctionCallArgumentsDelta, + type RealtimeServerEventResponseFunctionCallArgumentsDone, + type RealtimeServerEventResponseOutputItemAdded, + type RealtimeServerEventResponseOutputItemDone, + type RealtimeServerEventResponseTextDelta, + type RealtimeServerEventResponseTextDone, + type RealtimeServerEventSessionCreated, + type RealtimeServerEventSessionUpdated, + type RealtimeServerEventTranscriptionSessionUpdated, + type RealtimeSession, + type RealtimeSessionCreateRequest, + type RealtimeSessionCreateResponse, + type RealtimeTranscriptionSessionCreateRequest, + type RealtimeTranscriptionSessionCreateResponse, + type Reasoning, + ReasoningEffort, + type ReasoningItem, + type RefusalContent, + type Response, + type ResponseAudioDeltaEvent, + type ResponseAudioDoneEvent, + type ResponseAudioTranscriptDeltaEvent, + type ResponseAudioTranscriptDoneEvent, + type ResponseCodeInterpreterCallCodeDeltaEvent, + type ResponseCodeInterpreterCallCodeDoneEvent, + type ResponseCodeInterpreterCallCompletedEvent, + type ResponseCodeInterpreterCallInProgressEvent, + type ResponseCodeInterpreterCallInterpretingEvent, + type ResponseCompletedEvent, + type ResponseContentPartAddedEvent, + type ResponseContentPartDoneEvent, + type ResponseCreatedEvent, + type ResponseCustomToolCallInputDeltaEvent, + type ResponseCustomToolCallInputDoneEvent, + type ResponseError, + ResponseErrorCode, + type ResponseErrorEvent, + type ResponseFailedEvent, + type ResponseFileSearchCallCompletedEvent, + type ResponseFileSearchCallInProgressEvent, + type ResponseFileSearchCallSearchingEvent, + type ResponseFormatJsonObject, + type ResponseFormatJsonSchema, + type ResponseFormatJsonSchemaSchema, + type ResponseFormatText, + type ResponseFormatTextGrammar, + type ResponseFormatTextPython, + type ResponseFunctionCallArgumentsDeltaEvent, + type ResponseFunctionCallArgumentsDoneEvent, + type ResponseImageGenCallCompletedEvent, + type ResponseImageGenCallGeneratingEvent, + type ResponseImageGenCallInProgressEvent, + type ResponseImageGenCallPartialImageEvent, + type ResponseIncompleteEvent, + type ResponseInProgressEvent, + type ResponseItemList, + type ResponseLogProb, + type ResponseMcpCallArgumentsDeltaEvent, + type ResponseMcpCallArgumentsDoneEvent, + type ResponseMcpCallCompletedEvent, + type ResponseMcpCallFailedEvent, + type ResponseMcpCallInProgressEvent, + type ResponseMcpListToolsCompletedEvent, + type ResponseMcpListToolsFailedEvent, + type ResponseMcpListToolsInProgressEvent, + type ResponseModalities, + type ResponseOutputItemAddedEvent, + type ResponseOutputItemDoneEvent, + type ResponseOutputTextAnnotationAddedEvent, + type ResponsePromptVariables, + type ResponseProperties, + type ResponseQueuedEvent, + type ResponseReasoningSummaryPartAddedEvent, + type ResponseReasoningSummaryPartDoneEvent, + type ResponseReasoningSummaryTextDeltaEvent, + type ResponseReasoningSummaryTextDoneEvent, + type ResponseReasoningTextDeltaEvent, + type ResponseReasoningTextDoneEvent, + type ResponseRefusalDeltaEvent, + type ResponseRefusalDoneEvent, + type ResponseStreamEvent, + type ResponseStreamOptions, + type ResponseTextDeltaEvent, + type ResponseTextDoneEvent, + type ResponseUsage, + type ResponseWebSearchCallCompletedEvent, + type ResponseWebSearchCallInProgressEvent, + type ResponseWebSearchCallSearchingEvent, + type ResumeFineTuningJobData, + type ResumeFineTuningJobResponse, + type ResumeFineTuningJobResponses, + type RetrieveBatchData, + type RetrieveBatchResponse, + type RetrieveBatchResponses, + type RetrieveContainerData, + type RetrieveContainerFileContentData, + type RetrieveContainerFileContentResponses, + type RetrieveContainerFileData, + type RetrieveContainerFileResponse, + type RetrieveContainerFileResponses, + type RetrieveContainerResponse, + type RetrieveContainerResponses, + type RetrieveFileData, + type RetrieveFileResponse, + type RetrieveFileResponses, + type RetrieveFineTuningJobData, + type RetrieveFineTuningJobResponse, + type RetrieveFineTuningJobResponses, + type RetrieveInviteData, + type RetrieveInviteResponse, + type RetrieveInviteResponses, + type RetrieveModelData, + type RetrieveModelResponse, + type RetrieveModelResponses, + type RetrieveProjectApiKeyData, + type RetrieveProjectApiKeyResponse, + type RetrieveProjectApiKeyResponses, + type RetrieveProjectData, + type RetrieveProjectResponse, + type RetrieveProjectResponses, + type RetrieveProjectServiceAccountData, + type RetrieveProjectServiceAccountResponse, + type RetrieveProjectServiceAccountResponses, + type RetrieveProjectUserData, + type RetrieveProjectUserResponse, + type RetrieveProjectUserResponses, + type RetrieveUserData, + type RetrieveUserResponse, + type RetrieveUserResponses, + type RetrieveVectorStoreFileContentData, + type RetrieveVectorStoreFileContentResponse, + type RetrieveVectorStoreFileContentResponses, + type RunCompletionUsage, + type RunGraderData, + type RunGraderRequest, + type RunGraderResponse, + type RunGraderResponse2, + type RunGraderResponses, + type RunObject, + RunStatus, + type RunStepCompletionUsage, + type RunStepDeltaObject, + type RunStepDeltaObjectDelta, + type RunStepDeltaStepDetailsMessageCreationObject, + type RunStepDeltaStepDetailsToolCall, + type RunStepDeltaStepDetailsToolCallsCodeObject, + type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject, + type RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject, + type RunStepDeltaStepDetailsToolCallsFileSearchObject, + type RunStepDeltaStepDetailsToolCallsFunctionObject, + type RunStepDeltaStepDetailsToolCallsObject, + type RunStepDetailsMessageCreationObject, + type RunStepDetailsToolCall, + type RunStepDetailsToolCallsCodeObject, + type RunStepDetailsToolCallsCodeOutputImageObject, + type RunStepDetailsToolCallsCodeOutputLogsObject, + type RunStepDetailsToolCallsFileSearchObject, + type RunStepDetailsToolCallsFileSearchRankingOptionsObject, + type RunStepDetailsToolCallsFileSearchResultObject, + type RunStepDetailsToolCallsFunctionObject, + type RunStepDetailsToolCallsObject, + type RunStepObject, + type RunStepStreamEvent, + type RunStreamEvent, + type RunToolCallObject, + type Screenshot, + type Scroll, + type SearchVectorStoreData, + type SearchVectorStoreResponse, + type SearchVectorStoreResponses, + ServiceTier, + type SpeechAudioDeltaEvent, + type SpeechAudioDoneEvent, + type StaticChunkingStrategy, + type StaticChunkingStrategyRequestParam, + type StaticChunkingStrategyResponseParam, + type StopConfiguration, + type SubmitToolOuputsToRunData, + type SubmitToolOuputsToRunResponse, + type SubmitToolOuputsToRunResponses, + type SubmitToolOutputsRunRequest, + type SubmitToolOutputsRunRequestWithoutStream, + type TextAnnotation, + type TextAnnotationDelta, + type TextResponseFormatConfiguration, + type TextResponseFormatJsonSchema, + type ThreadObject, + type ThreadStreamEvent, + type ToggleCertificatesRequest, + type Tool, + type ToolChoiceAllowed, + type ToolChoiceCustom, + type ToolChoiceFunction, + type ToolChoiceMcp, + ToolChoiceOptions, + type ToolChoiceTypes, + type TopLogProb, + type TranscriptionChunkingStrategy, + TranscriptionInclude, + type TranscriptionSegment, + type TranscriptionWord, + type TranscriptTextDeltaEvent, + type TranscriptTextDoneEvent, + type TranscriptTextUsageDuration, + type TranscriptTextUsageTokens, + type TruncationObject, + type Type, + type UpdateChatCompletionData, + type UpdateChatCompletionResponse, + type UpdateChatCompletionResponses, + type UpdateEvalData, + type UpdateEvalResponse, + type UpdateEvalResponses, + type UpdateProjectRateLimitsData, + type UpdateProjectRateLimitsError, + type UpdateProjectRateLimitsErrors, + type UpdateProjectRateLimitsResponse, + type UpdateProjectRateLimitsResponses, + type UpdateVectorStoreFileAttributesData, + type UpdateVectorStoreFileAttributesRequest, + type UpdateVectorStoreFileAttributesResponse, + type UpdateVectorStoreFileAttributesResponses, + type UpdateVectorStoreRequest, + type Upload, + type UploadCertificateData, + type UploadCertificateRequest, + type UploadCertificateResponse, + type UploadCertificateResponses, + type UploadPart, + type UrlCitationBody, + type UsageAudioSpeechesData, + type UsageAudioSpeechesResponse, + type UsageAudioSpeechesResponses, + type UsageAudioSpeechesResult, + type UsageAudioTranscriptionsData, + type UsageAudioTranscriptionsResponse, + type UsageAudioTranscriptionsResponses, + type UsageAudioTranscriptionsResult, + type UsageCodeInterpreterSessionsData, + type UsageCodeInterpreterSessionsResponse, + type UsageCodeInterpreterSessionsResponses, + type UsageCodeInterpreterSessionsResult, + type UsageCompletionsData, + type UsageCompletionsResponse, + type UsageCompletionsResponses, + type UsageCompletionsResult, + type UsageCostsData, + type UsageCostsResponse, + type UsageCostsResponses, + type UsageEmbeddingsData, + type UsageEmbeddingsResponse, + type UsageEmbeddingsResponses, + type UsageEmbeddingsResult, + type UsageImagesData, + type UsageImagesResponse, + type UsageImagesResponses, + type UsageImagesResult, + type UsageModerationsData, + type UsageModerationsResponse, + type UsageModerationsResponses, + type UsageModerationsResult, + type UsageResponse, + type UsageTimeBucket, + type UsageVectorStoresData, + type UsageVectorStoresResponse, + type UsageVectorStoresResponses, + type UsageVectorStoresResult, + type User, + type UserDeleteResponse, + type UserListResponse, + type UserRoleUpdateRequest, + type VadConfig, + type ValidateGraderData, + type ValidateGraderRequest, + type ValidateGraderResponse, + type ValidateGraderResponse2, + type ValidateGraderResponses, + type VectorStoreExpirationAfter, + type VectorStoreFileAttributes, + type VectorStoreFileBatchObject, + type VectorStoreFileContentResponse, + type VectorStoreFileObject, + type VectorStoreObject, + type VectorStoreSearchRequest, + type VectorStoreSearchResultContentObject, + type VectorStoreSearchResultItem, + type VectorStoreSearchResultsPage, + Verbosity, + type VoiceIdsShared, + type Wait, + type WebhookBatchCancelled, + type WebhookBatchCompleted, + type WebhookBatchExpired, + type WebhookBatchFailed, + type WebhookEvalRunCanceled, + type WebhookEvalRunFailed, + type WebhookEvalRunSucceeded, + type WebhookFineTuningJobCancelled, + type WebhookFineTuningJobFailed, + type WebhookFineTuningJobSucceeded, + type WebhookResponseCancelled, + type WebhookResponseCompleted, + type WebhookResponseFailed, + type WebhookResponseIncomplete, + type Webhooks, + type WebSearchActionFind, + type WebSearchActionOpenPage, + type WebSearchActionSearch, + WebSearchContextSize, + type WebSearchLocation, + type WebSearchPreviewTool, + type WebSearchToolCall, +} from './types.gen'; diff --git a/examples/openapi-ts-openai/src/client/sdk.gen.ts b/examples/openapi-ts-openai/src/client/sdk.gen.ts index e0aaecdfa5..f5912d61eb 100644 --- a/examples/openapi-ts-openai/src/client/sdk.gen.ts +++ b/examples/openapi-ts-openai/src/client/sdk.gen.ts @@ -1,2568 +1,3497 @@ // This file is auto-generated by @hey-api/openapi-ts -import { type Client, formDataBodySerializer, type Options as Options2, type TDataShape } from './client'; +import { + type Client, + formDataBodySerializer, + type Options as Options2, + type TDataShape, +} from './client'; import { client } from './client.gen'; -import type { ActivateOrganizationCertificatesData, ActivateOrganizationCertificatesResponses, ActivateProjectCertificatesData, ActivateProjectCertificatesResponses, AddUploadPartData, AddUploadPartResponses, AdminApiKeysCreateData, AdminApiKeysCreateResponses, AdminApiKeysDeleteData, AdminApiKeysDeleteResponses, AdminApiKeysGetData, AdminApiKeysGetResponses, AdminApiKeysListData, AdminApiKeysListResponses, ArchiveProjectData, ArchiveProjectResponses, CancelBatchData, CancelBatchResponses, CancelEvalRunData, CancelEvalRunResponses, CancelFineTuningJobData, CancelFineTuningJobResponses, CancelResponseData, CancelResponseErrors, CancelResponseResponses, CancelRunData, CancelRunResponses, CancelUploadData, CancelUploadResponses, CancelVectorStoreFileBatchData, CancelVectorStoreFileBatchResponses, CompleteUploadData, CompleteUploadResponses, CreateAssistantData, CreateAssistantResponses, CreateBatchData, CreateBatchResponses, CreateChatCompletionData, CreateChatCompletionResponses, CreateCompletionData, CreateCompletionResponses, CreateContainerData, CreateContainerFileData, CreateContainerFileResponses, CreateContainerResponses, CreateEmbeddingData, CreateEmbeddingResponses, CreateEvalData, CreateEvalResponses, CreateEvalRunData, CreateEvalRunErrors, CreateEvalRunResponses, CreateFileData, CreateFileResponses, CreateFineTuningCheckpointPermissionData, CreateFineTuningCheckpointPermissionResponses, CreateFineTuningJobData, CreateFineTuningJobResponses, CreateImageData, CreateImageEditData, CreateImageEditResponses, CreateImageResponses, CreateImageVariationData, CreateImageVariationResponses, CreateMessageData, CreateMessageResponses, CreateModerationData, CreateModerationResponses, CreateProjectData, CreateProjectResponses, CreateProjectServiceAccountData, CreateProjectServiceAccountErrors, CreateProjectServiceAccountResponses, CreateProjectUserData, CreateProjectUserErrors, CreateProjectUserResponses, CreateRealtimeSessionData, CreateRealtimeSessionResponses, CreateRealtimeTranscriptionSessionData, CreateRealtimeTranscriptionSessionResponses, CreateResponseData, CreateResponseResponses, CreateRunData, CreateRunResponses, CreateSpeechData, CreateSpeechResponses, CreateThreadAndRunData, CreateThreadAndRunResponses, CreateThreadData, CreateThreadResponses, CreateTranscriptionData, CreateTranscriptionResponses, CreateTranslationData, CreateTranslationResponses, CreateUploadData, CreateUploadResponses, CreateVectorStoreData, CreateVectorStoreFileBatchData, CreateVectorStoreFileBatchResponses, CreateVectorStoreFileData, CreateVectorStoreFileResponses, CreateVectorStoreResponses, DeactivateOrganizationCertificatesData, DeactivateOrganizationCertificatesResponses, DeactivateProjectCertificatesData, DeactivateProjectCertificatesResponses, DeleteAssistantData, DeleteAssistantResponses, DeleteCertificateData, DeleteCertificateResponses, DeleteChatCompletionData, DeleteChatCompletionResponses, DeleteContainerData, DeleteContainerFileData, DeleteContainerFileResponses, DeleteContainerResponses, DeleteEvalData, DeleteEvalErrors, DeleteEvalResponses, DeleteEvalRunData, DeleteEvalRunErrors, DeleteEvalRunResponses, DeleteFileData, DeleteFileResponses, DeleteFineTuningCheckpointPermissionData, DeleteFineTuningCheckpointPermissionResponses, DeleteInviteData, DeleteInviteResponses, DeleteMessageData, DeleteMessageResponses, DeleteModelData, DeleteModelResponses, DeleteProjectApiKeyData, DeleteProjectApiKeyErrors, DeleteProjectApiKeyResponses, DeleteProjectServiceAccountData, DeleteProjectServiceAccountResponses, DeleteProjectUserData, DeleteProjectUserErrors, DeleteProjectUserResponses, DeleteResponseData, DeleteResponseErrors, DeleteResponseResponses, DeleteThreadData, DeleteThreadResponses, DeleteUserData, DeleteUserResponses, DeleteVectorStoreData, DeleteVectorStoreFileData, DeleteVectorStoreFileResponses, DeleteVectorStoreResponses, DownloadFileData, DownloadFileResponses, GetAssistantData, GetAssistantResponses, GetCertificateData, GetCertificateResponses, GetChatCompletionData, GetChatCompletionMessagesData, GetChatCompletionMessagesResponses, GetChatCompletionResponses, GetEvalData, GetEvalResponses, GetEvalRunData, GetEvalRunOutputItemData, GetEvalRunOutputItemResponses, GetEvalRunOutputItemsData, GetEvalRunOutputItemsResponses, GetEvalRunResponses, GetEvalRunsData, GetEvalRunsResponses, GetMessageData, GetMessageResponses, GetResponseData, GetResponseResponses, GetRunData, GetRunResponses, GetRunStepData, GetRunStepResponses, GetThreadData, GetThreadResponses, GetVectorStoreData, GetVectorStoreFileBatchData, GetVectorStoreFileBatchResponses, GetVectorStoreFileData, GetVectorStoreFileResponses, GetVectorStoreResponses, InviteUserData, InviteUserResponses, ListAssistantsData, ListAssistantsResponses, ListAuditLogsData, ListAuditLogsResponses, ListBatchesData, ListBatchesResponses, ListChatCompletionsData, ListChatCompletionsResponses, ListContainerFilesData, ListContainerFilesResponses, ListContainersData, ListContainersResponses, ListEvalsData, ListEvalsResponses, ListFilesData, ListFilesInVectorStoreBatchData, ListFilesInVectorStoreBatchResponses, ListFilesResponses, ListFineTuningCheckpointPermissionsData, ListFineTuningCheckpointPermissionsResponses, ListFineTuningEventsData, ListFineTuningEventsResponses, ListFineTuningJobCheckpointsData, ListFineTuningJobCheckpointsResponses, ListInputItemsData, ListInputItemsResponses, ListInvitesData, ListInvitesResponses, ListMessagesData, ListMessagesResponses, ListModelsData, ListModelsResponses, ListOrganizationCertificatesData, ListOrganizationCertificatesResponses, ListPaginatedFineTuningJobsData, ListPaginatedFineTuningJobsResponses, ListProjectApiKeysData, ListProjectApiKeysResponses, ListProjectCertificatesData, ListProjectCertificatesResponses, ListProjectRateLimitsData, ListProjectRateLimitsResponses, ListProjectsData, ListProjectServiceAccountsData, ListProjectServiceAccountsErrors, ListProjectServiceAccountsResponses, ListProjectsResponses, ListProjectUsersData, ListProjectUsersErrors, ListProjectUsersResponses, ListRunsData, ListRunsResponses, ListRunStepsData, ListRunStepsResponses, ListUsersData, ListUsersResponses, ListVectorStoreFilesData, ListVectorStoreFilesResponses, ListVectorStoresData, ListVectorStoresResponses, ModifyAssistantData, ModifyAssistantResponses, ModifyCertificateData, ModifyCertificateResponses, ModifyMessageData, ModifyMessageResponses, ModifyProjectData, ModifyProjectErrors, ModifyProjectResponses, ModifyProjectUserData, ModifyProjectUserErrors, ModifyProjectUserResponses, ModifyRunData, ModifyRunResponses, ModifyThreadData, ModifyThreadResponses, ModifyUserData, ModifyUserResponses, ModifyVectorStoreData, ModifyVectorStoreResponses, PauseFineTuningJobData, PauseFineTuningJobResponses, ResumeFineTuningJobData, ResumeFineTuningJobResponses, RetrieveBatchData, RetrieveBatchResponses, RetrieveContainerData, RetrieveContainerFileContentData, RetrieveContainerFileContentResponses, RetrieveContainerFileData, RetrieveContainerFileResponses, RetrieveContainerResponses, RetrieveFileData, RetrieveFileResponses, RetrieveFineTuningJobData, RetrieveFineTuningJobResponses, RetrieveInviteData, RetrieveInviteResponses, RetrieveModelData, RetrieveModelResponses, RetrieveProjectApiKeyData, RetrieveProjectApiKeyResponses, RetrieveProjectData, RetrieveProjectResponses, RetrieveProjectServiceAccountData, RetrieveProjectServiceAccountResponses, RetrieveProjectUserData, RetrieveProjectUserResponses, RetrieveUserData, RetrieveUserResponses, RetrieveVectorStoreFileContentData, RetrieveVectorStoreFileContentResponses, RunGraderData, RunGraderResponses, SearchVectorStoreData, SearchVectorStoreResponses, SubmitToolOuputsToRunData, SubmitToolOuputsToRunResponses, UpdateChatCompletionData, UpdateChatCompletionResponses, UpdateEvalData, UpdateEvalResponses, UpdateProjectRateLimitsData, UpdateProjectRateLimitsErrors, UpdateProjectRateLimitsResponses, UpdateVectorStoreFileAttributesData, UpdateVectorStoreFileAttributesResponses, UploadCertificateData, UploadCertificateResponses, UsageAudioSpeechesData, UsageAudioSpeechesResponses, UsageAudioTranscriptionsData, UsageAudioTranscriptionsResponses, UsageCodeInterpreterSessionsData, UsageCodeInterpreterSessionsResponses, UsageCompletionsData, UsageCompletionsResponses, UsageCostsData, UsageCostsResponses, UsageEmbeddingsData, UsageEmbeddingsResponses, UsageImagesData, UsageImagesResponses, UsageModerationsData, UsageModerationsResponses, UsageVectorStoresData, UsageVectorStoresResponses, ValidateGraderData, ValidateGraderResponses } from './types.gen'; - -export type Options = Options2 & { - /** - * You can provide a client instance returned by `createClient()` instead of - * individual options. This might be also useful if you want to implement a - * custom client. - */ - client?: Client; - /** - * You can pass arbitrary values through the `meta` object. This can be - * used to access values that aren't defined as part of the SDK function. - */ - meta?: Record; +import type { + ActivateOrganizationCertificatesData, + ActivateOrganizationCertificatesResponses, + ActivateProjectCertificatesData, + ActivateProjectCertificatesResponses, + AddUploadPartData, + AddUploadPartResponses, + AdminApiKeysCreateData, + AdminApiKeysCreateResponses, + AdminApiKeysDeleteData, + AdminApiKeysDeleteResponses, + AdminApiKeysGetData, + AdminApiKeysGetResponses, + AdminApiKeysListData, + AdminApiKeysListResponses, + ArchiveProjectData, + ArchiveProjectResponses, + CancelBatchData, + CancelBatchResponses, + CancelEvalRunData, + CancelEvalRunResponses, + CancelFineTuningJobData, + CancelFineTuningJobResponses, + CancelResponseData, + CancelResponseErrors, + CancelResponseResponses, + CancelRunData, + CancelRunResponses, + CancelUploadData, + CancelUploadResponses, + CancelVectorStoreFileBatchData, + CancelVectorStoreFileBatchResponses, + CompleteUploadData, + CompleteUploadResponses, + CreateAssistantData, + CreateAssistantResponses, + CreateBatchData, + CreateBatchResponses, + CreateChatCompletionData, + CreateChatCompletionResponses, + CreateCompletionData, + CreateCompletionResponses, + CreateContainerData, + CreateContainerFileData, + CreateContainerFileResponses, + CreateContainerResponses, + CreateEmbeddingData, + CreateEmbeddingResponses, + CreateEvalData, + CreateEvalResponses, + CreateEvalRunData, + CreateEvalRunErrors, + CreateEvalRunResponses, + CreateFileData, + CreateFileResponses, + CreateFineTuningCheckpointPermissionData, + CreateFineTuningCheckpointPermissionResponses, + CreateFineTuningJobData, + CreateFineTuningJobResponses, + CreateImageData, + CreateImageEditData, + CreateImageEditResponses, + CreateImageResponses, + CreateImageVariationData, + CreateImageVariationResponses, + CreateMessageData, + CreateMessageResponses, + CreateModerationData, + CreateModerationResponses, + CreateProjectData, + CreateProjectResponses, + CreateProjectServiceAccountData, + CreateProjectServiceAccountErrors, + CreateProjectServiceAccountResponses, + CreateProjectUserData, + CreateProjectUserErrors, + CreateProjectUserResponses, + CreateRealtimeSessionData, + CreateRealtimeSessionResponses, + CreateRealtimeTranscriptionSessionData, + CreateRealtimeTranscriptionSessionResponses, + CreateResponseData, + CreateResponseResponses, + CreateRunData, + CreateRunResponses, + CreateSpeechData, + CreateSpeechResponses, + CreateThreadAndRunData, + CreateThreadAndRunResponses, + CreateThreadData, + CreateThreadResponses, + CreateTranscriptionData, + CreateTranscriptionResponses, + CreateTranslationData, + CreateTranslationResponses, + CreateUploadData, + CreateUploadResponses, + CreateVectorStoreData, + CreateVectorStoreFileBatchData, + CreateVectorStoreFileBatchResponses, + CreateVectorStoreFileData, + CreateVectorStoreFileResponses, + CreateVectorStoreResponses, + DeactivateOrganizationCertificatesData, + DeactivateOrganizationCertificatesResponses, + DeactivateProjectCertificatesData, + DeactivateProjectCertificatesResponses, + DeleteAssistantData, + DeleteAssistantResponses, + DeleteCertificateData, + DeleteCertificateResponses, + DeleteChatCompletionData, + DeleteChatCompletionResponses, + DeleteContainerData, + DeleteContainerFileData, + DeleteContainerFileResponses, + DeleteContainerResponses, + DeleteEvalData, + DeleteEvalErrors, + DeleteEvalResponses, + DeleteEvalRunData, + DeleteEvalRunErrors, + DeleteEvalRunResponses, + DeleteFileData, + DeleteFileResponses, + DeleteFineTuningCheckpointPermissionData, + DeleteFineTuningCheckpointPermissionResponses, + DeleteInviteData, + DeleteInviteResponses, + DeleteMessageData, + DeleteMessageResponses, + DeleteModelData, + DeleteModelResponses, + DeleteProjectApiKeyData, + DeleteProjectApiKeyErrors, + DeleteProjectApiKeyResponses, + DeleteProjectServiceAccountData, + DeleteProjectServiceAccountResponses, + DeleteProjectUserData, + DeleteProjectUserErrors, + DeleteProjectUserResponses, + DeleteResponseData, + DeleteResponseErrors, + DeleteResponseResponses, + DeleteThreadData, + DeleteThreadResponses, + DeleteUserData, + DeleteUserResponses, + DeleteVectorStoreData, + DeleteVectorStoreFileData, + DeleteVectorStoreFileResponses, + DeleteVectorStoreResponses, + DownloadFileData, + DownloadFileResponses, + GetAssistantData, + GetAssistantResponses, + GetCertificateData, + GetCertificateResponses, + GetChatCompletionData, + GetChatCompletionMessagesData, + GetChatCompletionMessagesResponses, + GetChatCompletionResponses, + GetEvalData, + GetEvalResponses, + GetEvalRunData, + GetEvalRunOutputItemData, + GetEvalRunOutputItemResponses, + GetEvalRunOutputItemsData, + GetEvalRunOutputItemsResponses, + GetEvalRunResponses, + GetEvalRunsData, + GetEvalRunsResponses, + GetMessageData, + GetMessageResponses, + GetResponseData, + GetResponseResponses, + GetRunData, + GetRunResponses, + GetRunStepData, + GetRunStepResponses, + GetThreadData, + GetThreadResponses, + GetVectorStoreData, + GetVectorStoreFileBatchData, + GetVectorStoreFileBatchResponses, + GetVectorStoreFileData, + GetVectorStoreFileResponses, + GetVectorStoreResponses, + InviteUserData, + InviteUserResponses, + ListAssistantsData, + ListAssistantsResponses, + ListAuditLogsData, + ListAuditLogsResponses, + ListBatchesData, + ListBatchesResponses, + ListChatCompletionsData, + ListChatCompletionsResponses, + ListContainerFilesData, + ListContainerFilesResponses, + ListContainersData, + ListContainersResponses, + ListEvalsData, + ListEvalsResponses, + ListFilesData, + ListFilesInVectorStoreBatchData, + ListFilesInVectorStoreBatchResponses, + ListFilesResponses, + ListFineTuningCheckpointPermissionsData, + ListFineTuningCheckpointPermissionsResponses, + ListFineTuningEventsData, + ListFineTuningEventsResponses, + ListFineTuningJobCheckpointsData, + ListFineTuningJobCheckpointsResponses, + ListInputItemsData, + ListInputItemsResponses, + ListInvitesData, + ListInvitesResponses, + ListMessagesData, + ListMessagesResponses, + ListModelsData, + ListModelsResponses, + ListOrganizationCertificatesData, + ListOrganizationCertificatesResponses, + ListPaginatedFineTuningJobsData, + ListPaginatedFineTuningJobsResponses, + ListProjectApiKeysData, + ListProjectApiKeysResponses, + ListProjectCertificatesData, + ListProjectCertificatesResponses, + ListProjectRateLimitsData, + ListProjectRateLimitsResponses, + ListProjectsData, + ListProjectServiceAccountsData, + ListProjectServiceAccountsErrors, + ListProjectServiceAccountsResponses, + ListProjectsResponses, + ListProjectUsersData, + ListProjectUsersErrors, + ListProjectUsersResponses, + ListRunsData, + ListRunsResponses, + ListRunStepsData, + ListRunStepsResponses, + ListUsersData, + ListUsersResponses, + ListVectorStoreFilesData, + ListVectorStoreFilesResponses, + ListVectorStoresData, + ListVectorStoresResponses, + ModifyAssistantData, + ModifyAssistantResponses, + ModifyCertificateData, + ModifyCertificateResponses, + ModifyMessageData, + ModifyMessageResponses, + ModifyProjectData, + ModifyProjectErrors, + ModifyProjectResponses, + ModifyProjectUserData, + ModifyProjectUserErrors, + ModifyProjectUserResponses, + ModifyRunData, + ModifyRunResponses, + ModifyThreadData, + ModifyThreadResponses, + ModifyUserData, + ModifyUserResponses, + ModifyVectorStoreData, + ModifyVectorStoreResponses, + PauseFineTuningJobData, + PauseFineTuningJobResponses, + ResumeFineTuningJobData, + ResumeFineTuningJobResponses, + RetrieveBatchData, + RetrieveBatchResponses, + RetrieveContainerData, + RetrieveContainerFileContentData, + RetrieveContainerFileContentResponses, + RetrieveContainerFileData, + RetrieveContainerFileResponses, + RetrieveContainerResponses, + RetrieveFileData, + RetrieveFileResponses, + RetrieveFineTuningJobData, + RetrieveFineTuningJobResponses, + RetrieveInviteData, + RetrieveInviteResponses, + RetrieveModelData, + RetrieveModelResponses, + RetrieveProjectApiKeyData, + RetrieveProjectApiKeyResponses, + RetrieveProjectData, + RetrieveProjectResponses, + RetrieveProjectServiceAccountData, + RetrieveProjectServiceAccountResponses, + RetrieveProjectUserData, + RetrieveProjectUserResponses, + RetrieveUserData, + RetrieveUserResponses, + RetrieveVectorStoreFileContentData, + RetrieveVectorStoreFileContentResponses, + RunGraderData, + RunGraderResponses, + SearchVectorStoreData, + SearchVectorStoreResponses, + SubmitToolOuputsToRunData, + SubmitToolOuputsToRunResponses, + UpdateChatCompletionData, + UpdateChatCompletionResponses, + UpdateEvalData, + UpdateEvalResponses, + UpdateProjectRateLimitsData, + UpdateProjectRateLimitsErrors, + UpdateProjectRateLimitsResponses, + UpdateVectorStoreFileAttributesData, + UpdateVectorStoreFileAttributesResponses, + UploadCertificateData, + UploadCertificateResponses, + UsageAudioSpeechesData, + UsageAudioSpeechesResponses, + UsageAudioTranscriptionsData, + UsageAudioTranscriptionsResponses, + UsageCodeInterpreterSessionsData, + UsageCodeInterpreterSessionsResponses, + UsageCompletionsData, + UsageCompletionsResponses, + UsageCostsData, + UsageCostsResponses, + UsageEmbeddingsData, + UsageEmbeddingsResponses, + UsageImagesData, + UsageImagesResponses, + UsageModerationsData, + UsageModerationsResponses, + UsageVectorStoresData, + UsageVectorStoresResponses, + ValidateGraderData, + ValidateGraderResponses, +} from './types.gen'; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, +> = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; }; class HeyApiClient { - protected client: Client; - - constructor(args?: { - client?: Client; - }) { - this.client = args?.client ?? client; - } + protected client: Client; + + constructor(args?: { client?: Client }) { + this.client = args?.client ?? client; + } } class HeyApiRegistry { - private readonly defaultKey = 'default'; - - private readonly instances: Map = new Map(); - - get(key?: string): T { - const instance = this.instances.get(key ?? this.defaultKey); - if (!instance) { - throw new Error(`No SDK client found. Create one with "new OpenAi()" to fix this error.`); - } - return instance; - } - - set(value: T, key?: string): void { - this.instances.set(key ?? this.defaultKey, value); + private readonly defaultKey = 'default'; + + private readonly instances: Map = new Map(); + + get(key?: string): T { + const instance = this.instances.get(key ?? this.defaultKey); + if (!instance) { + throw new Error(`No SDK client found. Create one with "new OpenAi()" to fix this error.`); } + return instance; + } + + set(value: T, key?: string): void { + this.instances.set(key ?? this.defaultKey, value); + } } export class OpenAi extends HeyApiClient { - public static readonly __registry = new HeyApiRegistry(); - - constructor(args?: { - client?: Client; - key?: string; - }) { - super(args); - OpenAi.__registry.set(this, args?.key); - } - - /** - * List assistants - * - * Returns a list of assistants. - */ - public listAssistants(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/assistants', - ...options - }); - } - - /** - * Create assistant - * - * Create an assistant with a model and instructions. - */ - public createAssistant(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/assistants', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete assistant - * - * Delete an assistant. - */ - public deleteAssistant(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/assistants/{assistant_id}', - ...options - }); - } - - /** - * Retrieve assistant - * - * Retrieves an assistant. - */ - public getAssistant(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/assistants/{assistant_id}', - ...options - }); - } - - /** - * Modify assistant - * - * Modifies an assistant. - */ - public modifyAssistant(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/assistants/{assistant_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create speech - * - * Generates audio from the input text. - */ - public createSpeech(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/audio/speech', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create transcription - * - * Transcribes audio into the input language. - */ - public createTranscription(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/audio/transcriptions', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * Create translation - * - * Translates audio into English. - */ - public createTranslation(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/audio/translations', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * List batch - * - * List your organization's batches. - */ - public listBatches(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/batches', - ...options - }); - } - - /** - * Create batch - * - * Creates and executes a batch from an uploaded file of requests - */ - public createBatch(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/batches', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Retrieve batch - * - * Retrieves a batch. - */ - public retrieveBatch(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/batches/{batch_id}', - ...options - }); - } - - /** - * Cancel batch - * - * Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file. - */ - public cancelBatch(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/batches/{batch_id}/cancel', - ...options - }); - } - - /** - * List Chat Completions - * - * List stored Chat Completions. Only Chat Completions that have been stored - * with the `store` parameter set to `true` will be returned. - * - */ - public listChatCompletions(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/chat/completions', - ...options - }); - } - - /** - * Create chat completion - * - * **Starting a new project?** We recommend trying [Responses](https://platform.openai.com/docs/api-reference/responses) - * to take advantage of the latest OpenAI platform features. Compare - * [Chat Completions with Responses](https://platform.openai.com/docs/guides/responses-vs-chat-completions?api-mode=responses). - * - * --- - * - * Creates a model response for the given chat conversation. Learn more in the - * [text generation](https://platform.openai.com/docs/guides/text-generation), [vision](https://platform.openai.com/docs/guides/vision), - * and [audio](https://platform.openai.com/docs/guides/audio) guides. - * - * Parameter support can differ depending on the model used to generate the - * response, particularly for newer reasoning models. Parameters that are only - * supported for reasoning models are noted below. For the current state of - * unsupported parameters in reasoning models, - * [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). - * - */ - public createChatCompletion(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/chat/completions', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete chat completion - * - * Delete a stored chat completion. Only Chat Completions that have been - * created with the `store` parameter set to `true` can be deleted. - * - */ - public deleteChatCompletion(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/chat/completions/{completion_id}', - ...options - }); - } - - /** - * Get chat completion - * - * Get a stored chat completion. Only Chat Completions that have been created - * with the `store` parameter set to `true` will be returned. - * - */ - public getChatCompletion(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/chat/completions/{completion_id}', - ...options - }); - } - - /** - * Update chat completion - * - * Modify a stored chat completion. Only Chat Completions that have been - * created with the `store` parameter set to `true` can be modified. Currently, - * the only supported modification is to update the `metadata` field. - * - */ - public updateChatCompletion(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/chat/completions/{completion_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Get chat messages - * - * Get the messages in a stored chat completion. Only Chat Completions that - * have been created with the `store` parameter set to `true` will be - * returned. - * - */ - public getChatCompletionMessages(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/chat/completions/{completion_id}/messages', - ...options - }); - } - - /** - * Create completion - * - * Creates a completion for the provided prompt and parameters. - */ - public createCompletion(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/completions', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List containers - * - * List Containers - */ - public listContainers(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers', - ...options - }); - } - - /** - * Create container - * - * Create Container - */ - public createContainer(options?: Options) { - return (options?.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - /** - * Delete a container - * - * Delete Container - */ - public deleteContainer(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}', - ...options - }); - } - - /** - * Retrieve container - * - * Retrieve Container - */ - public retrieveContainer(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}', - ...options - }); - } - - /** - * List container files - * - * List Container files - */ - public listContainerFiles(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}/files', - ...options - }); - } - - /** - * Create container file - * - * Create a Container File - * - * You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID. - * - */ - public createContainerFile(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}/files', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * Delete a container file - * - * Delete Container File - */ - public deleteContainerFile(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}/files/{file_id}', - ...options - }); - } - - /** - * Retrieve container file - * - * Retrieve Container File - */ - public retrieveContainerFile(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}/files/{file_id}', - ...options - }); - } - - /** - * Retrieve container file content - * - * Retrieve Container File Content - */ - public retrieveContainerFileContent(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/containers/{container_id}/files/{file_id}/content', - ...options - }); - } - - /** - * Create embeddings - * - * Creates an embedding vector representing the input text. - */ - public createEmbedding(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/embeddings', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List evals - * - * List evaluations for a project. - * - */ - public listEvals(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals', - ...options - }); - } - - /** - * Create eval - * - * Create the structure of an evaluation that can be used to test a model's performance. - * An evaluation is a set of testing criteria and the config for a data source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources. - * For more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals). - * - */ - public createEval(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete an eval - * - * Delete an evaluation. - * - */ - public deleteEval(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}', - ...options - }); - } - - /** - * Get an eval - * - * Get an evaluation by ID. - * - */ - public getEval(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}', - ...options - }); - } - - /** - * Update an eval - * - * Update certain properties of an evaluation. - * - */ - public updateEval(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Get eval runs - * - * Get a list of runs for an evaluation. - * - */ - public getEvalRuns(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs', - ...options - }); - } - - /** - * Create eval run - * - * Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation. - * - */ - public createEvalRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete eval run - * - * Delete an eval run. - * - */ - public deleteEvalRun(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs/{run_id}', - ...options - }); - } - - /** - * Get an eval run - * - * Get an evaluation run by ID. - * - */ - public getEvalRun(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs/{run_id}', - ...options - }); - } - - /** - * Cancel eval run - * - * Cancel an ongoing evaluation run. - * - */ - public cancelEvalRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs/{run_id}', - ...options - }); - } - - /** - * Get eval run output items - * - * Get a list of output items for an evaluation run. - * - */ - public getEvalRunOutputItems(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs/{run_id}/output_items', - ...options - }); - } - - /** - * Get an output item of an eval run - * - * Get an evaluation run output item by ID. - * - */ - public getEvalRunOutputItem(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}', - ...options - }); - } - - /** - * List files - * - * Returns a list of files. - */ - public listFiles(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/files', - ...options - }); - } - - /** - * Upload file - * - * Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 1 TB. - * - * The Assistants API supports files up to 2 million tokens and of specific file types. See the [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) for details. - * - * The Fine-tuning API only supports `.jsonl` files. The input also has certain required formats for fine-tuning [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) models. - * - * The Batch API only supports `.jsonl` files up to 200 MB in size. The input also has a specific required [format](https://platform.openai.com/docs/api-reference/batch/request-input). - * - * Please [contact us](https://help.openai.com/) if you need to increase these storage limits. - * - */ - public createFile(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/files', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * Delete file - * - * Delete a file. - */ - public deleteFile(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/files/{file_id}', - ...options - }); - } - - /** - * Retrieve file - * - * Returns information about a specific file. - */ - public retrieveFile(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/files/{file_id}', - ...options - }); - } - - /** - * Retrieve file content - * - * Returns the contents of the specified file. - */ - public downloadFile(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/files/{file_id}/content', - ...options - }); - } - - /** - * Run grader - * - * Run a grader. - * - */ - public runGrader(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/alpha/graders/run', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Validate grader - * - * Validate a grader. - * - */ - public validateGrader(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/alpha/graders/validate', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List checkpoint permissions - * - * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). - * - * Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint. - * - */ - public listFineTuningCheckpointPermissions(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions', - ...options - }); - } - - /** - * Create checkpoint permissions - * - * **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). - * - * This enables organization owners to share fine-tuned models with other projects in their organization. - * - */ - public createFineTuningCheckpointPermission(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete checkpoint permission - * - * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). - * - * Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint. - * - */ - public deleteFineTuningCheckpointPermission(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}', - ...options - }); - } - - /** - * List fine-tuning jobs - * - * List your organization's fine-tuning jobs - * - */ - public listPaginatedFineTuningJobs(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs', - ...options - }); - } - - /** - * Create fine-tuning job - * - * Creates a fine-tuning job which begins the process of creating a new model from a given dataset. - * - * Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. - * - * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization) - * - */ - public createFineTuningJob(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Retrieve fine-tuning job - * - * Get info about a fine-tuning job. - * - * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization) - * - */ - public retrieveFineTuningJob(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs/{fine_tuning_job_id}', - ...options - }); - } - - /** - * Cancel fine-tuning - * - * Immediately cancel a fine-tune job. - * - */ - public cancelFineTuningJob(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs/{fine_tuning_job_id}/cancel', - ...options - }); - } - - /** - * List fine-tuning checkpoints - * - * List checkpoints for a fine-tuning job. - * - */ - public listFineTuningJobCheckpoints(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints', - ...options - }); - } - - /** - * List fine-tuning events - * - * Get status updates for a fine-tuning job. - * - */ - public listFineTuningEvents(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs/{fine_tuning_job_id}/events', - ...options - }); - } - - /** - * Pause fine-tuning - * - * Pause a fine-tune job. - * - */ - public pauseFineTuningJob(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs/{fine_tuning_job_id}/pause', - ...options - }); - } - - /** - * Resume fine-tuning - * - * Resume a fine-tune job. - * - */ - public resumeFineTuningJob(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/fine_tuning/jobs/{fine_tuning_job_id}/resume', - ...options - }); - } - - /** - * Create image edit - * - * 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`. - */ - public createImageEdit(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/images/edits', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * Create image - * - * Creates an image given a prompt. [Learn more](https://platform.openai.com/docs/guides/images). - * - */ - public createImage(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/images/generations', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create image variation - * - * Creates a variation of a given image. This endpoint only supports `dall-e-2`. - */ - public createImageVariation(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/images/variations', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * List models - * - * Lists the currently available models, and provides basic information about each one such as the owner and availability. - */ - public listModels(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/models', - ...options - }); - } - - /** - * Delete a fine-tuned model - * - * Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. - */ - public deleteModel(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/models/{model}', - ...options - }); - } - - /** - * Retrieve model - * - * Retrieves a model instance, providing basic information about the model such as the owner and permissioning. - */ - public retrieveModel(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/models/{model}', - ...options - }); - } - - /** - * Create moderation - * - * Classifies if text and/or image inputs are potentially harmful. Learn - * more in the [moderation guide](https://platform.openai.com/docs/guides/moderation). - * - */ - public createModeration(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/moderations', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List all organization and project API keys. - * - * List organization API keys - */ - public adminApiKeysList(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/admin_api_keys', - ...options - }); - } - - /** - * Create admin API key - * - * Create an organization admin API key - */ - public adminApiKeysCreate(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/admin_api_keys', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete admin API key - * - * Delete an organization admin API key - */ - public adminApiKeysDelete(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/admin_api_keys/{key_id}', - ...options - }); - } - - /** - * Retrieve admin API key - * - * Retrieve a single organization API key - */ - public adminApiKeysGet(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/admin_api_keys/{key_id}', - ...options - }); - } - - /** - * List audit logs - * - * List user actions and configuration changes within this organization. - */ - public listAuditLogs(options?: Options) { - return (options?.client ?? this.client).get({ - querySerializer: { parameters: { effective_at: { object: { style: 'form' } } } }, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/audit_logs', - ...options - }); - } - - /** - * List organization certificates - * - * List uploaded certificates for this organization. - */ - public listOrganizationCertificates(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates', - ...options - }); - } - - /** - * Upload certificate - * - * Upload a certificate to the organization. This does **not** automatically activate the certificate. - * - * Organizations can upload up to 50 certificates. - * - */ - public uploadCertificate(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Activate certificates for organization - * - * Activate certificates at the organization level. - * - * You can atomically and idempotently activate up to 10 certificates at a time. - * - */ - public activateOrganizationCertificates(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates/activate', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Deactivate certificates for organization - * - * Deactivate certificates at the organization level. - * - * You can atomically and idempotently deactivate up to 10 certificates at a time. - * - */ - public deactivateOrganizationCertificates(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates/deactivate', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete certificate - * - * Delete a certificate from the organization. - * - * The certificate must be inactive for the organization and all projects. - * - */ - public deleteCertificate(options?: Options) { - return (options?.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates/{certificate_id}', - ...options - }); - } - - /** - * Get certificate - * - * Get a certificate that has been uploaded to the organization. - * - * You can get a certificate regardless of whether it is active or not. - * - */ - public getCertificate(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates/{certificate_id}', - ...options - }); - } - - /** - * Modify certificate - * - * Modify a certificate. Note that only the name can be modified. - * - */ - public modifyCertificate(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/certificates/{certificate_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Costs - * - * Get costs details for the organization. - */ - public usageCosts(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/costs', - ...options - }); - } - - /** - * List invites - * - * Returns a list of invites in the organization. - */ - public listInvites(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/invites', - ...options - }); - } - - /** - * Create invite - * - * Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization. - */ - public inviteUser(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/invites', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete invite - * - * Delete an invite. If the invite has already been accepted, it cannot be deleted. - */ - public deleteInvite(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/invites/{invite_id}', - ...options - }); - } - - /** - * Retrieve invite - * - * Retrieves an invite. - */ - public retrieveInvite(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/invites/{invite_id}', - ...options - }); - } - - /** - * List projects - * - * Returns a list of projects. - */ - public listProjects(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects', - ...options - }); - } - - /** - * Create project - * - * Create a new project in the organization. Projects can be created and archived, but cannot be deleted. - */ - public createProject(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Retrieve project - * - * Retrieves a project. - */ - public retrieveProject(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}', - ...options - }); - } - - /** - * Modify project - * - * Modifies a project in the organization. - */ - public modifyProject(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List project API keys - * - * Returns a list of API keys in the project. - */ - public listProjectApiKeys(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/api_keys', - ...options - }); - } - - /** - * Delete project API key - * - * Deletes an API key from the project. - */ - public deleteProjectApiKey(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/api_keys/{key_id}', - ...options - }); - } - - /** - * Retrieve project API key - * - * Retrieves an API key in the project. - */ - public retrieveProjectApiKey(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/api_keys/{key_id}', - ...options - }); - } - - /** - * Archive project - * - * Archives a project in the organization. Archived projects cannot be used or updated. - */ - public archiveProject(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/archive', - ...options - }); - } - - /** - * List project certificates - * - * List certificates for this project. - */ - public listProjectCertificates(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/certificates', - ...options - }); - } - - /** - * Activate certificates for project - * - * Activate certificates at the project level. - * - * You can atomically and idempotently activate up to 10 certificates at a time. - * - */ - public activateProjectCertificates(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/certificates/activate', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Deactivate certificates for project - * - * Deactivate certificates at the project level. You can atomically and - * idempotently deactivate up to 10 certificates at a time. - * - */ - public deactivateProjectCertificates(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/certificates/deactivate', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List project rate limits - * - * Returns the rate limits per model for a project. - */ - public listProjectRateLimits(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/rate_limits', - ...options - }); - } - - /** - * Modify project rate limit - * - * Updates a project rate limit. - */ - public updateProjectRateLimits(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/rate_limits/{rate_limit_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List project service accounts - * - * Returns a list of service accounts in the project. - */ - public listProjectServiceAccounts(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/service_accounts', - ...options - }); - } - - /** - * Create project service account - * - * Creates a new service account in the project. This also returns an unredacted API key for the service account. - */ - public createProjectServiceAccount(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/service_accounts', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete project service account - * - * Deletes a service account from the project. - */ - public deleteProjectServiceAccount(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/service_accounts/{service_account_id}', - ...options - }); - } - - /** - * Retrieve project service account - * - * Retrieves a service account in the project. - */ - public retrieveProjectServiceAccount(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/service_accounts/{service_account_id}', - ...options - }); - } - - /** - * List project users - * - * Returns a list of users in the project. - */ - public listProjectUsers(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/users', - ...options - }); - } - - /** - * Create project user - * - * Adds a user to the project. Users must already be members of the organization to be added to a project. - */ - public createProjectUser(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/users', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete project user - * - * Deletes a user from the project. - */ - public deleteProjectUser(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/users/{user_id}', - ...options - }); - } - - /** - * Retrieve project user - * - * Retrieves a user in the project. - */ - public retrieveProjectUser(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/users/{user_id}', - ...options - }); - } - - /** - * Modify project user - * - * Modifies a user's role in the project. - */ - public modifyProjectUser(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/projects/{project_id}/users/{user_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Audio speeches - * - * Get audio speeches usage details for the organization. - */ - public usageAudioSpeeches(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/audio_speeches', - ...options - }); - } - - /** - * Audio transcriptions - * - * Get audio transcriptions usage details for the organization. - */ - public usageAudioTranscriptions(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/audio_transcriptions', - ...options - }); - } - - /** - * Code interpreter sessions - * - * Get code interpreter sessions usage details for the organization. - */ - public usageCodeInterpreterSessions(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/code_interpreter_sessions', - ...options - }); - } - - /** - * Completions - * - * Get completions usage details for the organization. - */ - public usageCompletions(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/completions', - ...options - }); - } - - /** - * Embeddings - * - * Get embeddings usage details for the organization. - */ - public usageEmbeddings(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/embeddings', - ...options - }); - } - - /** - * Images - * - * Get images usage details for the organization. - */ - public usageImages(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/images', - ...options - }); - } - - /** - * Moderations - * - * Get moderations usage details for the organization. - */ - public usageModerations(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/moderations', - ...options - }); - } - - /** - * Vector stores - * - * Get vector stores usage details for the organization. - */ - public usageVectorStores(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/usage/vector_stores', - ...options - }); - } - - /** - * List users - * - * Lists all of the users in the organization. - */ - public listUsers(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/users', - ...options - }); - } - - /** - * Delete user - * - * Deletes a user from the organization. - */ - public deleteUser(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/users/{user_id}', - ...options - }); - } - - /** - * Retrieve user - * - * Retrieves a user by their identifier. - */ - public retrieveUser(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/users/{user_id}', - ...options - }); - } - - /** - * Modify user - * - * Modifies a user's role in the organization. - */ - public modifyUser(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/organization/users/{user_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create session - * - * Create an ephemeral API token for use in client-side applications with the - * Realtime API. Can be configured with the same session parameters as the - * `session.update` client event. - * - * It responds with a session object, plus a `client_secret` key which contains - * a usable ephemeral API token that can be used to authenticate browser clients - * for the Realtime API. - * - */ - public createRealtimeSession(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/realtime/sessions', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create transcription session - * - * Create an ephemeral API token for use in client-side applications with the - * Realtime API specifically for realtime transcriptions. - * Can be configured with the same session parameters as the `transcription_session.update` client event. - * - * It responds with a session object, plus a `client_secret` key which contains - * a usable ephemeral API token that can be used to authenticate browser clients - * for the Realtime API. - * - */ - public createRealtimeTranscriptionSession(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/realtime/transcription_sessions', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create a model response - * - * Creates a model response. Provide [text](https://platform.openai.com/docs/guides/text) or - * [image](https://platform.openai.com/docs/guides/images) inputs to generate [text](https://platform.openai.com/docs/guides/text) - * or [JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have the model call - * your own [custom code](https://platform.openai.com/docs/guides/function-calling) or use built-in - * [tools](https://platform.openai.com/docs/guides/tools) like [web search](https://platform.openai.com/docs/guides/tools-web-search) - * or [file search](https://platform.openai.com/docs/guides/tools-file-search) to use your own data - * as input for the model's response. - * - */ - public createResponse(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/responses', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete a model response - * - * Deletes a model response with the given ID. - * - */ - public deleteResponse(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/responses/{response_id}', - ...options - }); - } - - /** - * Get a model response - * - * Retrieves a model response with the given ID. - * - */ - public getResponse(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/responses/{response_id}', - ...options - }); - } - - /** - * Cancel a response - * - * Cancels a model response with the given ID. Only responses created with - * the `background` parameter set to `true` can be cancelled. - * [Learn more](https://platform.openai.com/docs/guides/background). - * - */ - public cancelResponse(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/responses/{response_id}/cancel', - ...options - }); - } - - /** - * List input items - * - * Returns a list of input items for a given response. - */ - public listInputItems(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/responses/{response_id}/input_items', - ...options - }); - } - - /** - * Create thread - * - * Create a thread. - */ - public createThread(options?: Options) { - return (options?.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options?.headers - } - }); - } - - /** - * Create thread and run - * - * Create a thread and run it in one request. - */ - public createThreadAndRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/runs', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete thread - * - * Delete a thread. - */ - public deleteThread(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}', - ...options - }); - } - - /** - * Retrieve thread - * - * Retrieves a thread. - */ - public getThread(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}', - ...options - }); - } - - /** - * Modify thread - * - * Modifies a thread. - */ - public modifyThread(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List messages - * - * Returns a list of messages for a given thread. - */ - public listMessages(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/messages', - ...options - }); - } - - /** - * Create message - * - * Create a message. - */ - public createMessage(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/messages', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete message - * - * Deletes a message. - */ - public deleteMessage(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/messages/{message_id}', - ...options - }); - } - - /** - * Retrieve message - * - * Retrieve a message. - */ - public getMessage(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/messages/{message_id}', - ...options - }); - } - - /** - * Modify message - * - * Modifies a message. - */ - public modifyMessage(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/messages/{message_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * List runs - * - * Returns a list of runs belonging to a thread. - */ - public listRuns(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs', - ...options - }); - } - - /** - * Create run - * - * Create a run. - */ - public createRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Retrieve run - * - * Retrieves a run. - */ - public getRun(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs/{run_id}', - ...options - }); - } - - /** - * Modify run - * - * Modifies a run. - */ - public modifyRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs/{run_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Cancel a run - * - * Cancels a run that is `in_progress`. - */ - public cancelRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs/{run_id}/cancel', - ...options - }); - } - - /** - * List run steps - * - * Returns a list of run steps belonging to a run. - */ - public listRunSteps(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs/{run_id}/steps', - ...options - }); - } - - /** - * Retrieve run step - * - * Retrieves a run step. - */ - public getRunStep(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs/{run_id}/steps/{step_id}', - ...options - }); - } - - /** - * Submit tool outputs to run - * - * When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. - * - */ - public submitToolOuputsToRun(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create upload - * - * Creates an intermediate [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object - * that you can add [Parts](https://platform.openai.com/docs/api-reference/uploads/part-object) to. - * Currently, an Upload can accept at most 8 GB in total and expires after an - * hour after you create it. - * - * Once you complete the Upload, we will create a - * [File](https://platform.openai.com/docs/api-reference/files/object) object that contains all the parts - * you uploaded. This File is usable in the rest of our platform as a regular - * File object. - * - * For certain `purpose` values, the correct `mime_type` must be specified. - * Please refer to documentation for the - * [supported MIME types for your use case](https://platform.openai.com/docs/assistants/tools/file-search#supported-files). - * - * For guidance on the proper filename extensions for each purpose, please - * follow the documentation on [creating a - * File](https://platform.openai.com/docs/api-reference/files/create). - * - */ - public createUpload(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/uploads', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Cancel upload - * - * Cancels the Upload. No Parts may be added after an Upload is cancelled. - * - */ - public cancelUpload(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/uploads/{upload_id}/cancel', - ...options - }); - } - - /** - * Complete upload - * - * Completes the [Upload](https://platform.openai.com/docs/api-reference/uploads/object). - * - * Within the returned Upload object, there is a nested [File](https://platform.openai.com/docs/api-reference/files/object) object that is ready to use in the rest of the platform. - * - * You can specify the order of the Parts by passing in an ordered list of the Part IDs. - * - * The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. - * - */ - public completeUpload(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/uploads/{upload_id}/complete', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Add upload part - * - * Adds a [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object. A Part represents a chunk of bytes from the file you are trying to upload. - * - * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. - * - * It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete). - * - */ - public addUploadPart(options: Options) { - return (options.client ?? this.client).post({ - ...formDataBodySerializer, - security: [{ scheme: 'bearer', type: 'http' }], - url: '/uploads/{upload_id}/parts', - ...options, - headers: { - 'Content-Type': null, - ...options.headers - } - }); - } - - /** - * List vector stores - * - * Returns a list of vector stores. - */ - public listVectorStores(options?: Options) { - return (options?.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores', - ...options - }); - } - - /** - * Create vector store - * - * Create a vector store. - */ - public createVectorStore(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete vector store - * - * Delete a vector store. - */ - public deleteVectorStore(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}', - ...options - }); - } - - /** - * Retrieve vector store - * - * Retrieves a vector store. - */ - public getVectorStore(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}', - ...options - }); - } - - /** - * Modify vector store - * - * Modifies a vector store. - */ - public modifyVectorStore(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Create vector store file batch - * - * Create a vector store file batch. - */ - public createVectorStoreFileBatch(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/file_batches', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Retrieve vector store file batch - * - * Retrieves a vector store file batch. - */ - public getVectorStoreFileBatch(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}', - ...options - }); - } - - /** - * Cancel vector store file batch - * - * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. - */ - public cancelVectorStoreFileBatch(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel', - ...options - }); - } - - /** - * List vector store files in a batch - * - * Returns a list of vector store files in a batch. - */ - public listFilesInVectorStoreBatch(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files', - ...options - }); - } - - /** - * List vector store files - * - * Returns a list of vector store files. - */ - public listVectorStoreFiles(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/files', - ...options - }); - } - - /** - * Create vector store file - * - * Create a vector store file by attaching a [File](https://platform.openai.com/docs/api-reference/files) to a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object). - */ - public createVectorStoreFile(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/files', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Delete vector store file - * - * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](https://platform.openai.com/docs/api-reference/files/delete) endpoint. - */ - public deleteVectorStoreFile(options: Options) { - return (options.client ?? this.client).delete({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/files/{file_id}', - ...options - }); - } - - /** - * Retrieve vector store file - * - * Retrieves a vector store file. - */ - public getVectorStoreFile(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/files/{file_id}', - ...options - }); - } - - /** - * Update vector store file attributes - * - * Update attributes on a vector store file. - */ - public updateVectorStoreFileAttributes(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/files/{file_id}', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } - - /** - * Retrieve vector store file content - * - * Retrieve the parsed contents of a vector store file. - */ - public retrieveVectorStoreFileContent(options: Options) { - return (options.client ?? this.client).get({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/files/{file_id}/content', - ...options - }); - } - - /** - * Search vector store - * - * Search a vector store for relevant chunks based on a query and file attributes filter. - */ - public searchVectorStore(options: Options) { - return (options.client ?? this.client).post({ - security: [{ scheme: 'bearer', type: 'http' }], - url: '/vector_stores/{vector_store_id}/search', - ...options, - headers: { - 'Content-Type': 'application/json', - ...options.headers - } - }); - } + public static readonly __registry = new HeyApiRegistry(); + + constructor(args?: { client?: Client; key?: string }) { + super(args); + OpenAi.__registry.set(this, args?.key); + } + + /** + * List assistants + * + * Returns a list of assistants. + */ + public listAssistants( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/assistants', + ...options, + }); + } + + /** + * Create assistant + * + * Create an assistant with a model and instructions. + */ + public createAssistant( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/assistants', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete assistant + * + * Delete an assistant. + */ + public deleteAssistant( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/assistants/{assistant_id}', + ...options, + }); + } + + /** + * Retrieve assistant + * + * Retrieves an assistant. + */ + public getAssistant( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/assistants/{assistant_id}', + ...options, + }); + } + + /** + * Modify assistant + * + * Modifies an assistant. + */ + public modifyAssistant( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/assistants/{assistant_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create speech + * + * Generates audio from the input text. + */ + public createSpeech( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/audio/speech', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create transcription + * + * Transcribes audio into the input language. + */ + public createTranscription( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateTranscriptionResponses, + unknown, + ThrowOnError + >({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/audio/transcriptions', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * Create translation + * + * Translates audio into English. + */ + public createTranslation( + options: Options, + ) { + return (options.client ?? this.client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/audio/translations', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * List batch + * + * List your organization's batches. + */ + public listBatches( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/batches', + ...options, + }); + } + + /** + * Create batch + * + * Creates and executes a batch from an uploaded file of requests + */ + public createBatch( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/batches', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Retrieve batch + * + * Retrieves a batch. + */ + public retrieveBatch( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/batches/{batch_id}', + ...options, + }); + } + + /** + * Cancel batch + * + * Cancels an in-progress batch. The batch will be in status `cancelling` for up to 10 minutes, before changing to `cancelled`, where it will have partial results (if any) available in the output file. + */ + public cancelBatch( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/batches/{batch_id}/cancel', + ...options, + }); + } + + /** + * List Chat Completions + * + * List stored Chat Completions. Only Chat Completions that have been stored + * with the `store` parameter set to `true` will be returned. + * + */ + public listChatCompletions( + options?: Options, + ) { + return (options?.client ?? this.client).get< + ListChatCompletionsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/chat/completions', + ...options, + }); + } + + /** + * Create chat completion + * + * **Starting a new project?** We recommend trying [Responses](https://platform.openai.com/docs/api-reference/responses) + * to take advantage of the latest OpenAI platform features. Compare + * [Chat Completions with Responses](https://platform.openai.com/docs/guides/responses-vs-chat-completions?api-mode=responses). + * + * --- + * + * Creates a model response for the given chat conversation. Learn more in the + * [text generation](https://platform.openai.com/docs/guides/text-generation), [vision](https://platform.openai.com/docs/guides/vision), + * and [audio](https://platform.openai.com/docs/guides/audio) guides. + * + * Parameter support can differ depending on the model used to generate the + * response, particularly for newer reasoning models. Parameters that are only + * supported for reasoning models are noted below. For the current state of + * unsupported parameters in reasoning models, + * [refer to the reasoning guide](https://platform.openai.com/docs/guides/reasoning). + * + */ + public createChatCompletion( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateChatCompletionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/chat/completions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete chat completion + * + * Delete a stored chat completion. Only Chat Completions that have been + * created with the `store` parameter set to `true` can be deleted. + * + */ + public deleteChatCompletion( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteChatCompletionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/chat/completions/{completion_id}', + ...options, + }); + } + + /** + * Get chat completion + * + * Get a stored chat completion. Only Chat Completions that have been created + * with the `store` parameter set to `true` will be returned. + * + */ + public getChatCompletion( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/chat/completions/{completion_id}', + ...options, + }); + } + + /** + * Update chat completion + * + * Modify a stored chat completion. Only Chat Completions that have been + * created with the `store` parameter set to `true` can be modified. Currently, + * the only supported modification is to update the `metadata` field. + * + */ + public updateChatCompletion( + options: Options, + ) { + return (options.client ?? this.client).post< + UpdateChatCompletionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/chat/completions/{completion_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Get chat messages + * + * Get the messages in a stored chat completion. Only Chat Completions that + * have been created with the `store` parameter set to `true` will be + * returned. + * + */ + public getChatCompletionMessages( + options: Options, + ) { + return (options.client ?? this.client).get< + GetChatCompletionMessagesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/chat/completions/{completion_id}/messages', + ...options, + }); + } + + /** + * Create completion + * + * Creates a completion for the provided prompt and parameters. + */ + public createCompletion( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/completions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List containers + * + * List Containers + */ + public listContainers( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers', + ...options, + }); + } + + /** + * Create container + * + * Create Container + */ + public createContainer( + options?: Options, + ) { + return (options?.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers, + }, + }); + } + + /** + * Delete a container + * + * Delete Container + */ + public deleteContainer( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}', + ...options, + }); + } + + /** + * Retrieve container + * + * Retrieve Container + */ + public retrieveContainer( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}', + ...options, + }); + } + + /** + * List container files + * + * List Container files + */ + public listContainerFiles( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}/files', + ...options, + }); + } + + /** + * Create container file + * + * Create a Container File + * + * You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID. + * + */ + public createContainerFile( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateContainerFileResponses, + unknown, + ThrowOnError + >({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}/files', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * Delete a container file + * + * Delete Container File + */ + public deleteContainerFile( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteContainerFileResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}/files/{file_id}', + ...options, + }); + } + + /** + * Retrieve container file + * + * Retrieve Container File + */ + public retrieveContainerFile( + options: Options, + ) { + return (options.client ?? this.client).get< + RetrieveContainerFileResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}/files/{file_id}', + ...options, + }); + } + + /** + * Retrieve container file content + * + * Retrieve Container File Content + */ + public retrieveContainerFileContent( + options: Options, + ) { + return (options.client ?? this.client).get< + RetrieveContainerFileContentResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/containers/{container_id}/files/{file_id}/content', + ...options, + }); + } + + /** + * Create embeddings + * + * Creates an embedding vector representing the input text. + */ + public createEmbedding( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/embeddings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List evals + * + * List evaluations for a project. + * + */ + public listEvals( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals', + ...options, + }); + } + + /** + * Create eval + * + * Create the structure of an evaluation that can be used to test a model's performance. + * An evaluation is a set of testing criteria and the config for a data source, which dictates the schema of the data used in the evaluation. After creating an evaluation, you can run it on different models and model parameters. We support several types of graders and datasources. + * For more information, see the [Evals guide](https://platform.openai.com/docs/guides/evals). + * + */ + public createEval( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete an eval + * + * Delete an evaluation. + * + */ + public deleteEval( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteEvalResponses, + DeleteEvalErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}', + ...options, + }); + } + + /** + * Get an eval + * + * Get an evaluation by ID. + * + */ + public getEval( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}', + ...options, + }); + } + + /** + * Update an eval + * + * Update certain properties of an evaluation. + * + */ + public updateEval( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Get eval runs + * + * Get a list of runs for an evaluation. + * + */ + public getEvalRuns( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs', + ...options, + }); + } + + /** + * Create eval run + * + * Kicks off a new run for a given evaluation, specifying the data source, and what model configuration to use to test. The datasource will be validated against the schema specified in the config of the evaluation. + * + */ + public createEvalRun( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateEvalRunResponses, + CreateEvalRunErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete eval run + * + * Delete an eval run. + * + */ + public deleteEvalRun( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteEvalRunResponses, + DeleteEvalRunErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs/{run_id}', + ...options, + }); + } + + /** + * Get an eval run + * + * Get an evaluation run by ID. + * + */ + public getEvalRun( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs/{run_id}', + ...options, + }); + } + + /** + * Cancel eval run + * + * Cancel an ongoing evaluation run. + * + */ + public cancelEvalRun( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs/{run_id}', + ...options, + }); + } + + /** + * Get eval run output items + * + * Get a list of output items for an evaluation run. + * + */ + public getEvalRunOutputItems( + options: Options, + ) { + return (options.client ?? this.client).get< + GetEvalRunOutputItemsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs/{run_id}/output_items', + ...options, + }); + } + + /** + * Get an output item of an eval run + * + * Get an evaluation run output item by ID. + * + */ + public getEvalRunOutputItem( + options: Options, + ) { + return (options.client ?? this.client).get< + GetEvalRunOutputItemResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}', + ...options, + }); + } + + /** + * List files + * + * Returns a list of files. + */ + public listFiles( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/files', + ...options, + }); + } + + /** + * Upload file + * + * Upload a file that can be used across various endpoints. Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 1 TB. + * + * The Assistants API supports files up to 2 million tokens and of specific file types. See the [Assistants Tools guide](https://platform.openai.com/docs/assistants/tools) for details. + * + * The Fine-tuning API only supports `.jsonl` files. The input also has certain required formats for fine-tuning [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input) or [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) models. + * + * The Batch API only supports `.jsonl` files up to 200 MB in size. The input also has a specific required [format](https://platform.openai.com/docs/api-reference/batch/request-input). + * + * Please [contact us](https://help.openai.com/) if you need to increase these storage limits. + * + */ + public createFile( + options: Options, + ) { + return (options.client ?? this.client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/files', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * Delete file + * + * Delete a file. + */ + public deleteFile( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/files/{file_id}', + ...options, + }); + } + + /** + * Retrieve file + * + * Returns information about a specific file. + */ + public retrieveFile( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/files/{file_id}', + ...options, + }); + } + + /** + * Retrieve file content + * + * Returns the contents of the specified file. + */ + public downloadFile( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/files/{file_id}/content', + ...options, + }); + } + + /** + * Run grader + * + * Run a grader. + * + */ + public runGrader( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/alpha/graders/run', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Validate grader + * + * Validate a grader. + * + */ + public validateGrader( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/alpha/graders/validate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List checkpoint permissions + * + * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + * + * Organization owners can use this endpoint to view all permissions for a fine-tuned model checkpoint. + * + */ + public listFineTuningCheckpointPermissions( + options: Options, + ) { + return (options.client ?? this.client).get< + ListFineTuningCheckpointPermissionsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions', + ...options, + }); + } + + /** + * Create checkpoint permissions + * + * **NOTE:** Calling this endpoint requires an [admin API key](../admin-api-keys). + * + * This enables organization owners to share fine-tuned models with other projects in their organization. + * + */ + public createFineTuningCheckpointPermission( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateFineTuningCheckpointPermissionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete checkpoint permission + * + * **NOTE:** This endpoint requires an [admin API key](../admin-api-keys). + * + * Organization owners can use this endpoint to delete a permission for a fine-tuned model checkpoint. + * + */ + public deleteFineTuningCheckpointPermission( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteFineTuningCheckpointPermissionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}', + ...options, + }); + } + + /** + * List fine-tuning jobs + * + * List your organization's fine-tuning jobs + * + */ + public listPaginatedFineTuningJobs( + options?: Options, + ) { + return (options?.client ?? this.client).get< + ListPaginatedFineTuningJobsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs', + ...options, + }); + } + + /** + * Create fine-tuning job + * + * Creates a fine-tuning job which begins the process of creating a new model from a given dataset. + * + * Response includes details of the enqueued job including job status and the name of the fine-tuned models once complete. + * + * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization) + * + */ + public createFineTuningJob( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateFineTuningJobResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Retrieve fine-tuning job + * + * Get info about a fine-tuning job. + * + * [Learn more about fine-tuning](https://platform.openai.com/docs/guides/model-optimization) + * + */ + public retrieveFineTuningJob( + options: Options, + ) { + return (options.client ?? this.client).get< + RetrieveFineTuningJobResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs/{fine_tuning_job_id}', + ...options, + }); + } + + /** + * Cancel fine-tuning + * + * Immediately cancel a fine-tune job. + * + */ + public cancelFineTuningJob( + options: Options, + ) { + return (options.client ?? this.client).post< + CancelFineTuningJobResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs/{fine_tuning_job_id}/cancel', + ...options, + }); + } + + /** + * List fine-tuning checkpoints + * + * List checkpoints for a fine-tuning job. + * + */ + public listFineTuningJobCheckpoints( + options: Options, + ) { + return (options.client ?? this.client).get< + ListFineTuningJobCheckpointsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints', + ...options, + }); + } + + /** + * List fine-tuning events + * + * Get status updates for a fine-tuning job. + * + */ + public listFineTuningEvents( + options: Options, + ) { + return (options.client ?? this.client).get< + ListFineTuningEventsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs/{fine_tuning_job_id}/events', + ...options, + }); + } + + /** + * Pause fine-tuning + * + * Pause a fine-tune job. + * + */ + public pauseFineTuningJob( + options: Options, + ) { + return (options.client ?? this.client).post( + { + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs/{fine_tuning_job_id}/pause', + ...options, + }, + ); + } + + /** + * Resume fine-tuning + * + * Resume a fine-tune job. + * + */ + public resumeFineTuningJob( + options: Options, + ) { + return (options.client ?? this.client).post< + ResumeFineTuningJobResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/fine_tuning/jobs/{fine_tuning_job_id}/resume', + ...options, + }); + } + + /** + * Create image edit + * + * 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`. + */ + public createImageEdit( + options: Options, + ) { + return (options.client ?? this.client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/images/edits', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * Create image + * + * Creates an image given a prompt. [Learn more](https://platform.openai.com/docs/guides/images). + * + */ + public createImage( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/images/generations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create image variation + * + * Creates a variation of a given image. This endpoint only supports `dall-e-2`. + */ + public createImageVariation( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateImageVariationResponses, + unknown, + ThrowOnError + >({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/images/variations', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * List models + * + * Lists the currently available models, and provides basic information about each one such as the owner and availability. + */ + public listModels( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/models', + ...options, + }); + } + + /** + * Delete a fine-tuned model + * + * Delete a fine-tuned model. You must have the Owner role in your organization to delete a model. + */ + public deleteModel( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/models/{model}', + ...options, + }); + } + + /** + * Retrieve model + * + * Retrieves a model instance, providing basic information about the model such as the owner and permissioning. + */ + public retrieveModel( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/models/{model}', + ...options, + }); + } + + /** + * Create moderation + * + * Classifies if text and/or image inputs are potentially harmful. Learn + * more in the [moderation guide](https://platform.openai.com/docs/guides/moderation). + * + */ + public createModeration( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/moderations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List all organization and project API keys. + * + * List organization API keys + */ + public adminApiKeysList( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/admin_api_keys', + ...options, + }); + } + + /** + * Create admin API key + * + * Create an organization admin API key + */ + public adminApiKeysCreate( + options: Options, + ) { + return (options.client ?? this.client).post( + { + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/admin_api_keys', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }, + ); + } + + /** + * Delete admin API key + * + * Delete an organization admin API key + */ + public adminApiKeysDelete( + options: Options, + ) { + return (options.client ?? this.client).delete< + AdminApiKeysDeleteResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/admin_api_keys/{key_id}', + ...options, + }); + } + + /** + * Retrieve admin API key + * + * Retrieve a single organization API key + */ + public adminApiKeysGet( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/admin_api_keys/{key_id}', + ...options, + }); + } + + /** + * List audit logs + * + * List user actions and configuration changes within this organization. + */ + public listAuditLogs( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + querySerializer: { parameters: { effective_at: { object: { style: 'form' } } } }, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/audit_logs', + ...options, + }); + } + + /** + * List organization certificates + * + * List uploaded certificates for this organization. + */ + public listOrganizationCertificates( + options?: Options, + ) { + return (options?.client ?? this.client).get< + ListOrganizationCertificatesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates', + ...options, + }); + } + + /** + * Upload certificate + * + * Upload a certificate to the organization. This does **not** automatically activate the certificate. + * + * Organizations can upload up to 50 certificates. + * + */ + public uploadCertificate( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Activate certificates for organization + * + * Activate certificates at the organization level. + * + * You can atomically and idempotently activate up to 10 certificates at a time. + * + */ + public activateOrganizationCertificates( + options: Options, + ) { + return (options.client ?? this.client).post< + ActivateOrganizationCertificatesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates/activate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Deactivate certificates for organization + * + * Deactivate certificates at the organization level. + * + * You can atomically and idempotently deactivate up to 10 certificates at a time. + * + */ + public deactivateOrganizationCertificates( + options: Options, + ) { + return (options.client ?? this.client).post< + DeactivateOrganizationCertificatesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates/deactivate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete certificate + * + * Delete a certificate from the organization. + * + * The certificate must be inactive for the organization and all projects. + * + */ + public deleteCertificate( + options?: Options, + ) { + return (options?.client ?? this.client).delete< + DeleteCertificateResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates/{certificate_id}', + ...options, + }); + } + + /** + * Get certificate + * + * Get a certificate that has been uploaded to the organization. + * + * You can get a certificate regardless of whether it is active or not. + * + */ + public getCertificate( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates/{certificate_id}', + ...options, + }); + } + + /** + * Modify certificate + * + * Modify a certificate. Note that only the name can be modified. + * + */ + public modifyCertificate( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/certificates/{certificate_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Costs + * + * Get costs details for the organization. + */ + public usageCosts( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/costs', + ...options, + }); + } + + /** + * List invites + * + * Returns a list of invites in the organization. + */ + public listInvites( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/invites', + ...options, + }); + } + + /** + * Create invite + * + * Create an invite for a user to the organization. The invite must be accepted by the user before they have access to the organization. + */ + public inviteUser( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/invites', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete invite + * + * Delete an invite. If the invite has already been accepted, it cannot be deleted. + */ + public deleteInvite( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/invites/{invite_id}', + ...options, + }); + } + + /** + * Retrieve invite + * + * Retrieves an invite. + */ + public retrieveInvite( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/invites/{invite_id}', + ...options, + }); + } + + /** + * List projects + * + * Returns a list of projects. + */ + public listProjects( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects', + ...options, + }); + } + + /** + * Create project + * + * Create a new project in the organization. Projects can be created and archived, but cannot be deleted. + */ + public createProject( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Retrieve project + * + * Retrieves a project. + */ + public retrieveProject( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}', + ...options, + }); + } + + /** + * Modify project + * + * Modifies a project in the organization. + */ + public modifyProject( + options: Options, + ) { + return (options.client ?? this.client).post< + ModifyProjectResponses, + ModifyProjectErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List project API keys + * + * Returns a list of API keys in the project. + */ + public listProjectApiKeys( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/api_keys', + ...options, + }); + } + + /** + * Delete project API key + * + * Deletes an API key from the project. + */ + public deleteProjectApiKey( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteProjectApiKeyResponses, + DeleteProjectApiKeyErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/api_keys/{key_id}', + ...options, + }); + } + + /** + * Retrieve project API key + * + * Retrieves an API key in the project. + */ + public retrieveProjectApiKey( + options: Options, + ) { + return (options.client ?? this.client).get< + RetrieveProjectApiKeyResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/api_keys/{key_id}', + ...options, + }); + } + + /** + * Archive project + * + * Archives a project in the organization. Archived projects cannot be used or updated. + */ + public archiveProject( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/archive', + ...options, + }); + } + + /** + * List project certificates + * + * List certificates for this project. + */ + public listProjectCertificates( + options: Options, + ) { + return (options.client ?? this.client).get< + ListProjectCertificatesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/certificates', + ...options, + }); + } + + /** + * Activate certificates for project + * + * Activate certificates at the project level. + * + * You can atomically and idempotently activate up to 10 certificates at a time. + * + */ + public activateProjectCertificates( + options: Options, + ) { + return (options.client ?? this.client).post< + ActivateProjectCertificatesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/certificates/activate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Deactivate certificates for project + * + * Deactivate certificates at the project level. You can atomically and + * idempotently deactivate up to 10 certificates at a time. + * + */ + public deactivateProjectCertificates( + options: Options, + ) { + return (options.client ?? this.client).post< + DeactivateProjectCertificatesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/certificates/deactivate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List project rate limits + * + * Returns the rate limits per model for a project. + */ + public listProjectRateLimits( + options: Options, + ) { + return (options.client ?? this.client).get< + ListProjectRateLimitsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/rate_limits', + ...options, + }); + } + + /** + * Modify project rate limit + * + * Updates a project rate limit. + */ + public updateProjectRateLimits( + options: Options, + ) { + return (options.client ?? this.client).post< + UpdateProjectRateLimitsResponses, + UpdateProjectRateLimitsErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/rate_limits/{rate_limit_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List project service accounts + * + * Returns a list of service accounts in the project. + */ + public listProjectServiceAccounts( + options: Options, + ) { + return (options.client ?? this.client).get< + ListProjectServiceAccountsResponses, + ListProjectServiceAccountsErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/service_accounts', + ...options, + }); + } + + /** + * Create project service account + * + * Creates a new service account in the project. This also returns an unredacted API key for the service account. + */ + public createProjectServiceAccount( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateProjectServiceAccountResponses, + CreateProjectServiceAccountErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/service_accounts', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete project service account + * + * Deletes a service account from the project. + */ + public deleteProjectServiceAccount( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteProjectServiceAccountResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/service_accounts/{service_account_id}', + ...options, + }); + } + + /** + * Retrieve project service account + * + * Retrieves a service account in the project. + */ + public retrieveProjectServiceAccount( + options: Options, + ) { + return (options.client ?? this.client).get< + RetrieveProjectServiceAccountResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/service_accounts/{service_account_id}', + ...options, + }); + } + + /** + * List project users + * + * Returns a list of users in the project. + */ + public listProjectUsers( + options: Options, + ) { + return (options.client ?? this.client).get< + ListProjectUsersResponses, + ListProjectUsersErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/users', + ...options, + }); + } + + /** + * Create project user + * + * Adds a user to the project. Users must already be members of the organization to be added to a project. + */ + public createProjectUser( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateProjectUserResponses, + CreateProjectUserErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/users', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete project user + * + * Deletes a user from the project. + */ + public deleteProjectUser( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteProjectUserResponses, + DeleteProjectUserErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/users/{user_id}', + ...options, + }); + } + + /** + * Retrieve project user + * + * Retrieves a user in the project. + */ + public retrieveProjectUser( + options: Options, + ) { + return (options.client ?? this.client).get( + { + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/users/{user_id}', + ...options, + }, + ); + } + + /** + * Modify project user + * + * Modifies a user's role in the project. + */ + public modifyProjectUser( + options: Options, + ) { + return (options.client ?? this.client).post< + ModifyProjectUserResponses, + ModifyProjectUserErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/projects/{project_id}/users/{user_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Audio speeches + * + * Get audio speeches usage details for the organization. + */ + public usageAudioSpeeches( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/audio_speeches', + ...options, + }); + } + + /** + * Audio transcriptions + * + * Get audio transcriptions usage details for the organization. + */ + public usageAudioTranscriptions( + options: Options, + ) { + return (options.client ?? this.client).get< + UsageAudioTranscriptionsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/audio_transcriptions', + ...options, + }); + } + + /** + * Code interpreter sessions + * + * Get code interpreter sessions usage details for the organization. + */ + public usageCodeInterpreterSessions( + options: Options, + ) { + return (options.client ?? this.client).get< + UsageCodeInterpreterSessionsResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/code_interpreter_sessions', + ...options, + }); + } + + /** + * Completions + * + * Get completions usage details for the organization. + */ + public usageCompletions( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/completions', + ...options, + }); + } + + /** + * Embeddings + * + * Get embeddings usage details for the organization. + */ + public usageEmbeddings( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/embeddings', + ...options, + }); + } + + /** + * Images + * + * Get images usage details for the organization. + */ + public usageImages( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/images', + ...options, + }); + } + + /** + * Moderations + * + * Get moderations usage details for the organization. + */ + public usageModerations( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/moderations', + ...options, + }); + } + + /** + * Vector stores + * + * Get vector stores usage details for the organization. + */ + public usageVectorStores( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/usage/vector_stores', + ...options, + }); + } + + /** + * List users + * + * Lists all of the users in the organization. + */ + public listUsers( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/users', + ...options, + }); + } + + /** + * Delete user + * + * Deletes a user from the organization. + */ + public deleteUser( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/users/{user_id}', + ...options, + }); + } + + /** + * Retrieve user + * + * Retrieves a user by their identifier. + */ + public retrieveUser( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/users/{user_id}', + ...options, + }); + } + + /** + * Modify user + * + * Modifies a user's role in the organization. + */ + public modifyUser( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/organization/users/{user_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create session + * + * Create an ephemeral API token for use in client-side applications with the + * Realtime API. Can be configured with the same session parameters as the + * `session.update` client event. + * + * It responds with a session object, plus a `client_secret` key which contains + * a usable ephemeral API token that can be used to authenticate browser clients + * for the Realtime API. + * + */ + public createRealtimeSession( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateRealtimeSessionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/realtime/sessions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create transcription session + * + * Create an ephemeral API token for use in client-side applications with the + * Realtime API specifically for realtime transcriptions. + * Can be configured with the same session parameters as the `transcription_session.update` client event. + * + * It responds with a session object, plus a `client_secret` key which contains + * a usable ephemeral API token that can be used to authenticate browser clients + * for the Realtime API. + * + */ + public createRealtimeTranscriptionSession( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateRealtimeTranscriptionSessionResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/realtime/transcription_sessions', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create a model response + * + * Creates a model response. Provide [text](https://platform.openai.com/docs/guides/text) or + * [image](https://platform.openai.com/docs/guides/images) inputs to generate [text](https://platform.openai.com/docs/guides/text) + * or [JSON](https://platform.openai.com/docs/guides/structured-outputs) outputs. Have the model call + * your own [custom code](https://platform.openai.com/docs/guides/function-calling) or use built-in + * [tools](https://platform.openai.com/docs/guides/tools) like [web search](https://platform.openai.com/docs/guides/tools-web-search) + * or [file search](https://platform.openai.com/docs/guides/tools-file-search) to use your own data + * as input for the model's response. + * + */ + public createResponse( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/responses', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete a model response + * + * Deletes a model response with the given ID. + * + */ + public deleteResponse( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteResponseResponses, + DeleteResponseErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/responses/{response_id}', + ...options, + }); + } + + /** + * Get a model response + * + * Retrieves a model response with the given ID. + * + */ + public getResponse( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/responses/{response_id}', + ...options, + }); + } + + /** + * Cancel a response + * + * Cancels a model response with the given ID. Only responses created with + * the `background` parameter set to `true` can be cancelled. + * [Learn more](https://platform.openai.com/docs/guides/background). + * + */ + public cancelResponse( + options: Options, + ) { + return (options.client ?? this.client).post< + CancelResponseResponses, + CancelResponseErrors, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/responses/{response_id}/cancel', + ...options, + }); + } + + /** + * List input items + * + * Returns a list of input items for a given response. + */ + public listInputItems( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/responses/{response_id}/input_items', + ...options, + }); + } + + /** + * Create thread + * + * Create a thread. + */ + public createThread( + options?: Options, + ) { + return (options?.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers, + }, + }); + } + + /** + * Create thread and run + * + * Create a thread and run it in one request. + */ + public createThreadAndRun( + options: Options, + ) { + return (options.client ?? this.client).post( + { + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/runs', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }, + ); + } + + /** + * Delete thread + * + * Delete a thread. + */ + public deleteThread( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}', + ...options, + }); + } + + /** + * Retrieve thread + * + * Retrieves a thread. + */ + public getThread( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}', + ...options, + }); + } + + /** + * Modify thread + * + * Modifies a thread. + */ + public modifyThread( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List messages + * + * Returns a list of messages for a given thread. + */ + public listMessages( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/messages', + ...options, + }); + } + + /** + * Create message + * + * Create a message. + */ + public createMessage( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/messages', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete message + * + * Deletes a message. + */ + public deleteMessage( + options: Options, + ) { + return (options.client ?? this.client).delete({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/messages/{message_id}', + ...options, + }); + } + + /** + * Retrieve message + * + * Retrieve a message. + */ + public getMessage( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/messages/{message_id}', + ...options, + }); + } + + /** + * Modify message + * + * Modifies a message. + */ + public modifyMessage( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/messages/{message_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * List runs + * + * Returns a list of runs belonging to a thread. + */ + public listRuns( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs', + ...options, + }); + } + + /** + * Create run + * + * Create a run. + */ + public createRun( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Retrieve run + * + * Retrieves a run. + */ + public getRun(options: Options) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs/{run_id}', + ...options, + }); + } + + /** + * Modify run + * + * Modifies a run. + */ + public modifyRun( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs/{run_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Cancel a run + * + * Cancels a run that is `in_progress`. + */ + public cancelRun( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs/{run_id}/cancel', + ...options, + }); + } + + /** + * List run steps + * + * Returns a list of run steps belonging to a run. + */ + public listRunSteps( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs/{run_id}/steps', + ...options, + }); + } + + /** + * Retrieve run step + * + * Retrieves a run step. + */ + public getRunStep( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs/{run_id}/steps/{step_id}', + ...options, + }); + } + + /** + * Submit tool outputs to run + * + * When a run has the `status: "requires_action"` and `required_action.type` is `submit_tool_outputs`, this endpoint can be used to submit the outputs from the tool calls once they're all completed. All outputs must be submitted in a single request. + * + */ + public submitToolOuputsToRun( + options: Options, + ) { + return (options.client ?? this.client).post< + SubmitToolOuputsToRunResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create upload + * + * Creates an intermediate [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object + * that you can add [Parts](https://platform.openai.com/docs/api-reference/uploads/part-object) to. + * Currently, an Upload can accept at most 8 GB in total and expires after an + * hour after you create it. + * + * Once you complete the Upload, we will create a + * [File](https://platform.openai.com/docs/api-reference/files/object) object that contains all the parts + * you uploaded. This File is usable in the rest of our platform as a regular + * File object. + * + * For certain `purpose` values, the correct `mime_type` must be specified. + * Please refer to documentation for the + * [supported MIME types for your use case](https://platform.openai.com/docs/assistants/tools/file-search#supported-files). + * + * For guidance on the proper filename extensions for each purpose, please + * follow the documentation on [creating a + * File](https://platform.openai.com/docs/api-reference/files/create). + * + */ + public createUpload( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/uploads', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Cancel upload + * + * Cancels the Upload. No Parts may be added after an Upload is cancelled. + * + */ + public cancelUpload( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/uploads/{upload_id}/cancel', + ...options, + }); + } + + /** + * Complete upload + * + * Completes the [Upload](https://platform.openai.com/docs/api-reference/uploads/object). + * + * Within the returned Upload object, there is a nested [File](https://platform.openai.com/docs/api-reference/files/object) object that is ready to use in the rest of the platform. + * + * You can specify the order of the Parts by passing in an ordered list of the Part IDs. + * + * The number of bytes uploaded upon completion must match the number of bytes initially specified when creating the Upload object. No Parts may be added after an Upload is completed. + * + */ + public completeUpload( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/uploads/{upload_id}/complete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Add upload part + * + * Adds a [Part](https://platform.openai.com/docs/api-reference/uploads/part-object) to an [Upload](https://platform.openai.com/docs/api-reference/uploads/object) object. A Part represents a chunk of bytes from the file you are trying to upload. + * + * Each Part can be at most 64 MB, and you can add Parts until you hit the Upload maximum of 8 GB. + * + * It is possible to add multiple Parts in parallel. You can decide the intended order of the Parts when you [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete). + * + */ + public addUploadPart( + options: Options, + ) { + return (options.client ?? this.client).post({ + ...formDataBodySerializer, + security: [{ scheme: 'bearer', type: 'http' }], + url: '/uploads/{upload_id}/parts', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + } + + /** + * List vector stores + * + * Returns a list of vector stores. + */ + public listVectorStores( + options?: Options, + ) { + return (options?.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores', + ...options, + }); + } + + /** + * Create vector store + * + * Create a vector store. + */ + public createVectorStore( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete vector store + * + * Delete a vector store. + */ + public deleteVectorStore( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteVectorStoreResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}', + ...options, + }); + } + + /** + * Retrieve vector store + * + * Retrieves a vector store. + */ + public getVectorStore( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}', + ...options, + }); + } + + /** + * Modify vector store + * + * Modifies a vector store. + */ + public modifyVectorStore( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Create vector store file batch + * + * Create a vector store file batch. + */ + public createVectorStoreFileBatch( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateVectorStoreFileBatchResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/file_batches', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Retrieve vector store file batch + * + * Retrieves a vector store file batch. + */ + public getVectorStoreFileBatch( + options: Options, + ) { + return (options.client ?? this.client).get< + GetVectorStoreFileBatchResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}', + ...options, + }); + } + + /** + * Cancel vector store file batch + * + * Cancel a vector store file batch. This attempts to cancel the processing of files in this batch as soon as possible. + */ + public cancelVectorStoreFileBatch( + options: Options, + ) { + return (options.client ?? this.client).post< + CancelVectorStoreFileBatchResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel', + ...options, + }); + } + + /** + * List vector store files in a batch + * + * Returns a list of vector store files in a batch. + */ + public listFilesInVectorStoreBatch( + options: Options, + ) { + return (options.client ?? this.client).get< + ListFilesInVectorStoreBatchResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files', + ...options, + }); + } + + /** + * List vector store files + * + * Returns a list of vector store files. + */ + public listVectorStoreFiles( + options: Options, + ) { + return (options.client ?? this.client).get< + ListVectorStoreFilesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/files', + ...options, + }); + } + + /** + * Create vector store file + * + * Create a vector store file by attaching a [File](https://platform.openai.com/docs/api-reference/files) to a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object). + */ + public createVectorStoreFile( + options: Options, + ) { + return (options.client ?? this.client).post< + CreateVectorStoreFileResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/files', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Delete vector store file + * + * Delete a vector store file. This will remove the file from the vector store but the file itself will not be deleted. To delete the file, use the [delete file](https://platform.openai.com/docs/api-reference/files/delete) endpoint. + */ + public deleteVectorStoreFile( + options: Options, + ) { + return (options.client ?? this.client).delete< + DeleteVectorStoreFileResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/files/{file_id}', + ...options, + }); + } + + /** + * Retrieve vector store file + * + * Retrieves a vector store file. + */ + public getVectorStoreFile( + options: Options, + ) { + return (options.client ?? this.client).get({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/files/{file_id}', + ...options, + }); + } + + /** + * Update vector store file attributes + * + * Update attributes on a vector store file. + */ + public updateVectorStoreFileAttributes( + options: Options, + ) { + return (options.client ?? this.client).post< + UpdateVectorStoreFileAttributesResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/files/{file_id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } + + /** + * Retrieve vector store file content + * + * Retrieve the parsed contents of a vector store file. + */ + public retrieveVectorStoreFileContent( + options: Options, + ) { + return (options.client ?? this.client).get< + RetrieveVectorStoreFileContentResponses, + unknown, + ThrowOnError + >({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/files/{file_id}/content', + ...options, + }); + } + + /** + * Search vector store + * + * Search a vector store for relevant chunks based on a query and file attributes filter. + */ + public searchVectorStore( + options: Options, + ) { + return (options.client ?? this.client).post({ + security: [{ scheme: 'bearer', type: 'http' }], + url: '/vector_stores/{vector_store_id}/search', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + } } diff --git a/examples/openapi-ts-openai/src/client/types.gen.ts b/examples/openapi-ts-openai/src/client/types.gen.ts index 30951d9e90..52a933d971 100644 --- a/examples/openapi-ts-openai/src/client/types.gen.ts +++ b/examples/openapi-ts-openai/src/client/types.gen.ts @@ -1,85 +1,99 @@ // This file is auto-generated by @hey-api/openapi-ts export type ClientOptions = { - baseUrl: 'https://api.openai.com/v1' | (string & {}); -}; - -export type Webhooks = PostBatchCancelledWebhookRequest | PostBatchCompletedWebhookRequest | PostBatchExpiredWebhookRequest | PostBatchFailedWebhookRequest | PostEvalRunCanceledWebhookRequest | PostEvalRunFailedWebhookRequest | PostEvalRunSucceededWebhookRequest | PostFineTuningJobCancelledWebhookRequest | PostFineTuningJobFailedWebhookRequest | PostFineTuningJobSucceededWebhookRequest | PostResponseCancelledWebhookRequest | PostResponseCompletedWebhookRequest | PostResponseFailedWebhookRequest | PostResponseIncompleteWebhookRequest; + baseUrl: 'https://api.openai.com/v1' | (string & {}); +}; + +export type Webhooks = + | PostBatchCancelledWebhookRequest + | PostBatchCompletedWebhookRequest + | PostBatchExpiredWebhookRequest + | PostBatchFailedWebhookRequest + | PostEvalRunCanceledWebhookRequest + | PostEvalRunFailedWebhookRequest + | PostEvalRunSucceededWebhookRequest + | PostFineTuningJobCancelledWebhookRequest + | PostFineTuningJobFailedWebhookRequest + | PostFineTuningJobSucceededWebhookRequest + | PostResponseCancelledWebhookRequest + | PostResponseCompletedWebhookRequest + | PostResponseFailedWebhookRequest + | PostResponseIncompleteWebhookRequest; export type AddUploadPartRequest = { - /** - * The chunk of bytes for this Part. - * - */ - data: Blob | File; + /** + * The chunk of bytes for this Part. + * + */ + data: Blob | File; }; /** * Represents an individual Admin API key in an org. */ export type AdminApiKey = { - /** - * The object type, which is always `organization.admin_api_key` + /** + * The object type, which is always `organization.admin_api_key` + */ + object: string; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the API key + */ + name: string; + /** + * The redacted value of the API key + */ + redacted_value: string; + /** + * The value of the API key. Only shown on create. + */ + value?: string; + /** + * The Unix timestamp (in seconds) of when the API key was created + */ + created_at: number; + /** + * The Unix timestamp (in seconds) of when the API key was last used + */ + last_used_at: number; + owner: { + /** + * Always `user` + */ + type?: string; + /** + * The object type, which is always organization.user */ - object: string; + object?: string; /** * The identifier, which can be referenced in API endpoints */ - id: string; - /** - * The name of the API key - */ - name: string; - /** - * The redacted value of the API key - */ - redacted_value: string; + id?: string; /** - * The value of the API key. Only shown on create. + * The name of the user */ - value?: string; + name?: string; /** - * The Unix timestamp (in seconds) of when the API key was created + * The Unix timestamp (in seconds) of when the user was created */ - created_at: number; + created_at?: number; /** - * The Unix timestamp (in seconds) of when the API key was last used + * Always `owner` */ - last_used_at: number; - owner: { - /** - * Always `user` - */ - type?: string; - /** - * The object type, which is always organization.user - */ - object?: string; - /** - * The identifier, which can be referenced in API endpoints - */ - id?: string; - /** - * The name of the user - */ - name?: string; - /** - * The Unix timestamp (in seconds) of when the user was created - */ - created_at?: number; - /** - * Always `owner` - */ - role?: string; - }; + role?: string; + }; }; export type ApiKeyList = { - object?: string; - data?: Array; - has_more?: boolean; - first_id?: string; - last_id?: string; + object?: string; + data?: Array; + has_more?: boolean; + first_id?: string; + last_id?: string; }; /** @@ -88,77 +102,77 @@ export type ApiKeyList = { * Represents an `assistant` that can call the model and use tools. */ export type AssistantObject = { - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `assistant`. - */ - object: 'assistant'; - /** - * The Unix timestamp (in seconds) for when the assistant was created. - */ - created_at: number; - /** - * The name of the assistant. The maximum length is 256 characters. - * - */ - name: string; - /** - * The description of the assistant. The maximum length is 512 characters. - * - */ - description: string; - /** - * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - * - */ - model: string; - /** - * The system instructions that the assistant uses. The maximum length is 256,000 characters. - * - */ - instructions: string; - /** - * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - * - */ - tools: Array; - /** - * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources?: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: { - /** - * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - * - */ - vector_store_ids?: Array; - }; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `assistant`. + */ + object: 'assistant'; + /** + * The Unix timestamp (in seconds) for when the assistant was created. + */ + created_at: number; + /** + * The name of the assistant. The maximum length is 256 characters. + * + */ + name: string; + /** + * The description of the assistant. The maximum length is 512 characters. + * + */ + description: string; + /** + * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + * + */ + model: string; + /** + * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * + */ + instructions: string; + /** + * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + * + */ + tools: Array; + /** + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter`` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; }; - metadata: Metadata; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * - */ - top_p?: number; - response_format?: AssistantsApiResponseFormatOption; + file_search?: { + /** + * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + * + */ + vector_store_ids?: Array; + }; + }; + metadata: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + response_format?: AssistantsApiResponseFormatOption; }; /** @@ -183,117 +197,123 @@ export type AssistantObject = { * integrate the Assistants API with streaming. * */ -export type AssistantStreamEvent = ({ - event?: 'ThreadStreamEvent'; -} & ThreadStreamEvent) | ({ - event?: 'RunStreamEvent'; -} & RunStreamEvent) | ({ - event?: 'RunStepStreamEvent'; -} & RunStepStreamEvent) | ({ - event?: 'MessageStreamEvent'; -} & MessageStreamEvent) | ({ - event?: 'ErrorEvent'; -} & ErrorEvent); +export type AssistantStreamEvent = + | ({ + event?: 'ThreadStreamEvent'; + } & ThreadStreamEvent) + | ({ + event?: 'RunStreamEvent'; + } & RunStreamEvent) + | ({ + event?: 'RunStepStreamEvent'; + } & RunStepStreamEvent) + | ({ + event?: 'MessageStreamEvent'; + } & MessageStreamEvent) + | ({ + event?: 'ErrorEvent'; + } & ErrorEvent); export const AssistantSupportedModels = { - GPT_5: 'gpt-5', - GPT_5_MINI: 'gpt-5-mini', - GPT_5_NANO: 'gpt-5-nano', - GPT_5_2025_08_07: 'gpt-5-2025-08-07', - GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', - GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07', - GPT_4_1: 'gpt-4.1', - GPT_4_1_MINI: 'gpt-4.1-mini', - GPT_4_1_NANO: 'gpt-4.1-nano', - GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', - GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', - GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', - O3_MINI: 'o3-mini', - O3_MINI_2025_01_31: 'o3-mini-2025-01-31', - O1: 'o1', - O1_2024_12_17: 'o1-2024-12-17', - GPT_4O: 'gpt-4o', - GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', - GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', - GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', - GPT_4O_MINI: 'gpt-4o-mini', - GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', - GPT_4_5_PREVIEW: 'gpt-4.5-preview', - GPT_4_5_PREVIEW_2025_02_27: 'gpt-4.5-preview-2025-02-27', - GPT_4_TURBO: 'gpt-4-turbo', - GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09', - GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', - GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview', - GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', - GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', - GPT_4: 'gpt-4', - GPT_4_0314: 'gpt-4-0314', - GPT_4_0613: 'gpt-4-0613', - GPT_4_32K: 'gpt-4-32k', - GPT_4_32K_0314: 'gpt-4-32k-0314', - GPT_4_32K_0613: 'gpt-4-32k-0613', - GPT_3_5_TURBO: 'gpt-3.5-turbo', - GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', - GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', - GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', - GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', - GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613' + GPT_5: 'gpt-5', + GPT_5_MINI: 'gpt-5-mini', + GPT_5_NANO: 'gpt-5-nano', + GPT_5_2025_08_07: 'gpt-5-2025-08-07', + GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', + GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07', + GPT_4_1: 'gpt-4.1', + GPT_4_1_MINI: 'gpt-4.1-mini', + GPT_4_1_NANO: 'gpt-4.1-nano', + GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', + GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', + GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', + O3_MINI: 'o3-mini', + O3_MINI_2025_01_31: 'o3-mini-2025-01-31', + O1: 'o1', + O1_2024_12_17: 'o1-2024-12-17', + GPT_4O: 'gpt-4o', + GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', + GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', + GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', + GPT_4O_MINI: 'gpt-4o-mini', + GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', + GPT_4_5_PREVIEW: 'gpt-4.5-preview', + GPT_4_5_PREVIEW_2025_02_27: 'gpt-4.5-preview-2025-02-27', + GPT_4_TURBO: 'gpt-4-turbo', + GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09', + GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', + GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview', + GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', + GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', + GPT_4: 'gpt-4', + GPT_4_0314: 'gpt-4-0314', + GPT_4_0613: 'gpt-4-0613', + GPT_4_32K: 'gpt-4-32k', + GPT_4_32K_0314: 'gpt-4-32k-0314', + GPT_4_32K_0613: 'gpt-4-32k-0613', + GPT_3_5_TURBO: 'gpt-3.5-turbo', + GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', + GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', + GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', + GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', + GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613', } as const; -export type AssistantSupportedModels = typeof AssistantSupportedModels[keyof typeof AssistantSupportedModels]; +export type AssistantSupportedModels = + (typeof AssistantSupportedModels)[keyof typeof AssistantSupportedModels]; /** * Code interpreter tool */ export type AssistantToolsCode = { - /** - * The type of tool being defined: `code_interpreter` - */ - type: 'code_interpreter'; + /** + * The type of tool being defined: `code_interpreter` + */ + type: 'code_interpreter'; }; /** * FileSearch tool */ export type AssistantToolsFileSearch = { + /** + * The type of tool being defined: `file_search` + */ + type: 'file_search'; + /** + * Overrides for the file search tool. + */ + file_search?: { /** - * The type of tool being defined: `file_search` - */ - type: 'file_search'; - /** - * Overrides for the file search tool. + * The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. + * + * Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + * */ - file_search?: { - /** - * The maximum number of results the file search tool should output. The default is 20 for `gpt-4*` models and 5 for `gpt-3.5-turbo`. This number should be between 1 and 50 inclusive. - * - * Note that the file search tool may output fewer than `max_num_results` results. See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - * - */ - max_num_results?: number; - ranking_options?: FileSearchRankingOptions; - }; + max_num_results?: number; + ranking_options?: FileSearchRankingOptions; + }; }; /** * FileSearch tool */ export type AssistantToolsFileSearchTypeOnly = { - /** - * The type of tool being defined: `file_search` - */ - type: 'file_search'; + /** + * The type of tool being defined: `file_search` + */ + type: 'file_search'; }; /** * Function tool */ export type AssistantToolsFunction = { - /** - * The type of tool being defined: `function` - */ - type: 'function'; - function: FunctionObject; + /** + * The type of tool being defined: `function` + */ + type: 'function'; + function: FunctionObject; }; /** @@ -306,7 +326,11 @@ export type AssistantToolsFunction = { * **Important:** when using JSON mode, you **must** also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if `finish_reason="length"`, which indicates the generation exceeded `max_tokens` or the conversation exceeded the max context length. * */ -export type AssistantsApiResponseFormatOption = 'auto' | ResponseFormatText | ResponseFormatJsonObject | ResponseFormatJsonSchema; +export type AssistantsApiResponseFormatOption = + | 'auto' + | ResponseFormatText + | ResponseFormatJsonObject + | ResponseFormatJsonSchema; /** * Controls which (if any) tool is called by the model. @@ -316,22 +340,26 @@ export type AssistantsApiResponseFormatOption = 'auto' | ResponseFormatText | Re * Specifying a particular tool like `{"type": "file_search"}` or `{"type": "function", "function": {"name": "my_function"}}` forces the model to call that tool. * */ -export type AssistantsApiToolChoiceOption = 'none' | 'auto' | 'required' | AssistantsNamedToolChoice; +export type AssistantsApiToolChoiceOption = + | 'none' + | 'auto' + | 'required' + | AssistantsNamedToolChoice; /** * Specifies a tool the model should use. Use to force the model to call a specific tool. */ export type AssistantsNamedToolChoice = { + /** + * The type of the tool. If type is `function`, the function name must be set + */ + type: 'function' | 'code_interpreter' | 'file_search'; + function?: { /** - * The type of the tool. If type is `function`, the function name must be set + * The name of the function to call. */ - type: 'function' | 'code_interpreter' | 'file_search'; - function?: { - /** - * The name of the function to call. - */ - name: string; - }; + name: string; + }; }; /** @@ -339,588 +367,588 @@ export type AssistantsNamedToolChoice = { * */ export const AudioResponseFormat = { - JSON: 'json', - TEXT: 'text', - SRT: 'srt', - VERBOSE_JSON: 'verbose_json', - VTT: 'vtt' + JSON: 'json', + TEXT: 'text', + SRT: 'srt', + VERBOSE_JSON: 'verbose_json', + VTT: 'vtt', } as const; /** * The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. For `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`, the only supported format is `json`. * */ -export type AudioResponseFormat = typeof AudioResponseFormat[keyof typeof AudioResponseFormat]; +export type AudioResponseFormat = (typeof AudioResponseFormat)[keyof typeof AudioResponseFormat]; /** * A log of a user action or configuration change within this organization. */ export type AuditLog = { + /** + * The ID of this log. + */ + id: string; + type: AuditLogEventType; + /** + * The Unix timestamp (in seconds) of the event. + */ + effective_at: number; + /** + * The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project. + */ + project?: { + /** + * The project ID. + */ + id?: string; /** - * The ID of this log. + * The project title. */ - id: string; - type: AuditLogEventType; + name?: string; + }; + actor: AuditLogActor; + /** + * The details for events with this `type`. + */ + 'api_key.created'?: { /** - * The Unix timestamp (in seconds) of the event. + * The tracking ID of the API key. */ - effective_at: number; + id?: string; /** - * The project that the action was scoped to. Absent for actions not scoped to projects. Note that any admin actions taken via Admin API keys are associated with the default project. + * The payload used to create the API key. */ - project?: { - /** - * The project ID. - */ - id?: string; - /** - * The project title. - */ - name?: string; + data?: { + /** + * A list of scopes allowed for the API key, e.g. `["api.model.request"]` + */ + scopes?: Array; }; - actor: AuditLogActor; + }; + /** + * The details for events with this `type`. + */ + 'api_key.updated'?: { /** - * The details for events with this `type`. + * The tracking ID of the API key. */ - 'api_key.created'?: { - /** - * The tracking ID of the API key. - */ - id?: string; - /** - * The payload used to create the API key. - */ - data?: { - /** - * A list of scopes allowed for the API key, e.g. `["api.model.request"]` - */ - scopes?: Array; - }; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to update the API key. */ - 'api_key.updated'?: { - /** - * The tracking ID of the API key. - */ - id?: string; - /** - * The payload used to update the API key. - */ - changes_requested?: { - /** - * A list of scopes allowed for the API key, e.g. `["api.model.request"]` - */ - scopes?: Array; - }; + changes_requested?: { + /** + * A list of scopes allowed for the API key, e.g. `["api.model.request"]` + */ + scopes?: Array; }; + }; + /** + * The details for events with this `type`. + */ + 'api_key.deleted'?: { /** - * The details for events with this `type`. + * The tracking ID of the API key. */ - 'api_key.deleted'?: { - /** - * The tracking ID of the API key. - */ - id?: string; - }; + id?: string; + }; + /** + * The project and fine-tuned model checkpoint that the checkpoint permission was created for. + */ + 'checkpoint_permission.created'?: { /** - * The project and fine-tuned model checkpoint that the checkpoint permission was created for. + * The ID of the checkpoint permission. */ - 'checkpoint_permission.created'?: { - /** - * The ID of the checkpoint permission. - */ - id?: string; - /** - * The payload used to create the checkpoint permission. - */ - data?: { - /** - * The ID of the project that the checkpoint permission was created for. - */ - project_id?: string; - /** - * The ID of the fine-tuned model checkpoint. - */ - fine_tuned_model_checkpoint?: string; - }; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to create the checkpoint permission. */ - 'checkpoint_permission.deleted'?: { - /** - * The ID of the checkpoint permission. - */ - id?: string; - }; + data?: { + /** + * The ID of the project that the checkpoint permission was created for. + */ + project_id?: string; + /** + * The ID of the fine-tuned model checkpoint. + */ + fine_tuned_model_checkpoint?: string; + }; + }; + /** + * The details for events with this `type`. + */ + 'checkpoint_permission.deleted'?: { + /** + * The ID of the checkpoint permission. + */ + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'invite.sent'?: { /** - * The details for events with this `type`. + * The ID of the invite. */ - 'invite.sent'?: { - /** - * The ID of the invite. - */ - id?: string; - /** - * The payload used to create the invite. - */ - data?: { - /** - * The email invited to the organization. - */ - email?: string; - /** - * The role the email was invited to be. Is either `owner` or `member`. - */ - role?: string; - }; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to create the invite. */ - 'invite.accepted'?: { - /** - * The ID of the invite. - */ - id?: string; - }; + data?: { + /** + * The email invited to the organization. + */ + email?: string; + /** + * The role the email was invited to be. Is either `owner` or `member`. + */ + role?: string; + }; + }; + /** + * The details for events with this `type`. + */ + 'invite.accepted'?: { + /** + * The ID of the invite. + */ + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'invite.deleted'?: { /** - * The details for events with this `type`. + * The ID of the invite. */ - 'invite.deleted'?: { - /** - * The ID of the invite. - */ - id?: string; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'login.failed'?: { /** - * The details for events with this `type`. + * The error code of the failure. */ - 'login.failed'?: { - /** - * The error code of the failure. - */ - error_code?: string; - /** - * The error message of the failure. - */ - error_message?: string; - }; + error_code?: string; /** - * The details for events with this `type`. + * The error message of the failure. */ - 'logout.failed'?: { - /** - * The error code of the failure. - */ - error_code?: string; - /** - * The error message of the failure. - */ - error_message?: string; - }; + error_message?: string; + }; + /** + * The details for events with this `type`. + */ + 'logout.failed'?: { /** - * The details for events with this `type`. + * The error code of the failure. */ - 'organization.updated'?: { - /** - * The organization ID. - */ - id?: string; - /** - * The payload used to update the organization settings. - */ - changes_requested?: { - /** - * The organization title. - */ - title?: string; - /** - * The organization description. - */ - description?: string; - /** - * The organization name. - */ - name?: string; - /** - * Visibility of the threads page which shows messages created with the Assistants API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`. - */ - threads_ui_visibility?: string; - /** - * Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`. - */ - usage_dashboard_visibility?: string; - /** - * How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects` - */ - api_call_logging?: string; - /** - * The list of project ids if api_call_logging is set to `enabled_for_selected_projects` - */ - api_call_logging_project_ids?: string; - }; - }; + error_code?: string; /** - * The details for events with this `type`. + * The error message of the failure. */ - 'project.created'?: { - /** - * The project ID. - */ - id?: string; - /** - * The payload used to create the project. - */ - data?: { - /** - * The project name. - */ - name?: string; - /** - * The title of the project as seen on the dashboard. - */ - title?: string; - }; - }; + error_message?: string; + }; + /** + * The details for events with this `type`. + */ + 'organization.updated'?: { /** - * The details for events with this `type`. + * The organization ID. */ - 'project.updated'?: { - /** - * The project ID. - */ - id?: string; - /** - * The payload used to update the project. - */ - changes_requested?: { - /** - * The title of the project as seen on the dashboard. - */ - title?: string; - }; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to update the organization settings. + */ + changes_requested?: { + /** + * The organization title. + */ + title?: string; + /** + * The organization description. + */ + description?: string; + /** + * The organization name. + */ + name?: string; + /** + * Visibility of the threads page which shows messages created with the Assistants API and Playground. One of `ANY_ROLE`, `OWNERS`, or `NONE`. + */ + threads_ui_visibility?: string; + /** + * Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`. + */ + usage_dashboard_visibility?: string; + /** + * How your organization logs data from supported API calls. One of `disabled`, `enabled_per_call`, `enabled_for_all_projects`, or `enabled_for_selected_projects` + */ + api_call_logging?: string; + /** + * The list of project ids if api_call_logging is set to `enabled_for_selected_projects` + */ + api_call_logging_project_ids?: string; + }; + }; + /** + * The details for events with this `type`. + */ + 'project.created'?: { + /** + * The project ID. */ - 'project.archived'?: { - /** - * The project ID. - */ - id?: string; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to create the project. */ - 'rate_limit.updated'?: { - /** - * The rate limit ID - */ - id?: string; - /** - * The payload used to update the rate limits. - */ - changes_requested?: { - /** - * The maximum requests per minute. - */ - max_requests_per_1_minute?: number; - /** - * The maximum tokens per minute. - */ - max_tokens_per_1_minute?: number; - /** - * The maximum images per minute. Only relevant for certain models. - */ - max_images_per_1_minute?: number; - /** - * The maximum audio megabytes per minute. Only relevant for certain models. - */ - max_audio_megabytes_per_1_minute?: number; - /** - * The maximum requests per day. Only relevant for certain models. - */ - max_requests_per_1_day?: number; - /** - * The maximum batch input tokens per day. Only relevant for certain models. - */ - batch_1_day_max_input_tokens?: number; - }; - }; + data?: { + /** + * The project name. + */ + name?: string; + /** + * The title of the project as seen on the dashboard. + */ + title?: string; + }; + }; + /** + * The details for events with this `type`. + */ + 'project.updated'?: { + /** + * The project ID. + */ + id?: string; /** - * The details for events with this `type`. + * The payload used to update the project. */ - 'rate_limit.deleted'?: { - /** - * The rate limit ID - */ - id?: string; + changes_requested?: { + /** + * The title of the project as seen on the dashboard. + */ + title?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'project.archived'?: { /** - * The details for events with this `type`. + * The project ID. */ - 'service_account.created'?: { - /** - * The service account ID. - */ - id?: string; - /** - * The payload used to create the service account. - */ - data?: { - /** - * The role of the service account. Is either `owner` or `member`. - */ - role?: string; - }; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'rate_limit.updated'?: { /** - * The details for events with this `type`. + * The rate limit ID */ - 'service_account.updated'?: { - /** - * The service account ID. - */ - id?: string; - /** - * The payload used to updated the service account. - */ - changes_requested?: { - /** - * The role of the service account. Is either `owner` or `member`. - */ - role?: string; - }; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to update the rate limits. + */ + changes_requested?: { + /** + * The maximum requests per minute. + */ + max_requests_per_1_minute?: number; + /** + * The maximum tokens per minute. + */ + max_tokens_per_1_minute?: number; + /** + * The maximum images per minute. Only relevant for certain models. + */ + max_images_per_1_minute?: number; + /** + * The maximum audio megabytes per minute. Only relevant for certain models. + */ + max_audio_megabytes_per_1_minute?: number; + /** + * The maximum requests per day. Only relevant for certain models. + */ + max_requests_per_1_day?: number; + /** + * The maximum batch input tokens per day. Only relevant for certain models. + */ + batch_1_day_max_input_tokens?: number; + }; + }; + /** + * The details for events with this `type`. + */ + 'rate_limit.deleted'?: { + /** + * The rate limit ID */ - 'service_account.deleted'?: { - /** - * The service account ID. - */ - id?: string; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'service_account.created'?: { /** - * The details for events with this `type`. + * The service account ID. */ - 'user.added'?: { - /** - * The user ID. - */ - id?: string; - /** - * The payload used to add the user to the project. - */ - data?: { - /** - * The role of the user. Is either `owner` or `member`. - */ - role?: string; - }; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to create the service account. */ - 'user.updated'?: { - /** - * The project ID. - */ - id?: string; - /** - * The payload used to update the user. - */ - changes_requested?: { - /** - * The role of the user. Is either `owner` or `member`. - */ - role?: string; - }; + data?: { + /** + * The role of the service account. Is either `owner` or `member`. + */ + role?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'service_account.updated'?: { /** - * The details for events with this `type`. + * The service account ID. */ - 'user.deleted'?: { - /** - * The user ID. - */ - id?: string; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to updated the service account. */ - 'certificate.created'?: { - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; + changes_requested?: { + /** + * The role of the service account. Is either `owner` or `member`. + */ + role?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'service_account.deleted'?: { /** - * The details for events with this `type`. + * The service account ID. */ - 'certificate.updated'?: { - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'user.added'?: { /** - * The details for events with this `type`. + * The user ID. */ - 'certificate.deleted'?: { - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; - /** - * The certificate content in PEM format. - */ - certificate?: string; - }; + id?: string; /** - * The details for events with this `type`. + * The payload used to add the user to the project. */ - 'certificates.activated'?: { - certificates?: Array<{ - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; - }>; + data?: { + /** + * The role of the user. Is either `owner` or `member`. + */ + role?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'user.updated'?: { /** - * The details for events with this `type`. + * The project ID. */ - 'certificates.deactivated'?: { - certificates?: Array<{ - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; - }>; + id?: string; + /** + * The payload used to update the user. + */ + changes_requested?: { + /** + * The role of the user. Is either `owner` or `member`. + */ + role?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'user.deleted'?: { + /** + * The user ID. + */ + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificate.created'?: { + /** + * The certificate ID. + */ + id?: string; + /** + * The name of the certificate. + */ + name?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificate.updated'?: { + /** + * The certificate ID. + */ + id?: string; + /** + * The name of the certificate. + */ + name?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificate.deleted'?: { + /** + * The certificate ID. + */ + id?: string; + /** + * The name of the certificate. + */ + name?: string; + /** + * The certificate content in PEM format. + */ + certificate?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificates.activated'?: { + certificates?: Array<{ + /** + * The certificate ID. + */ + id?: string; + /** + * The name of the certificate. + */ + name?: string; + }>; + }; + /** + * The details for events with this `type`. + */ + 'certificates.deactivated'?: { + certificates?: Array<{ + /** + * The certificate ID. + */ + id?: string; + /** + * The name of the certificate. + */ + name?: string; + }>; + }; }; /** * The actor who performed the audit logged action. */ export type AuditLogActor = { - /** - * The type of actor. Is either `session` or `api_key`. - */ - type?: 'session' | 'api_key'; - session?: AuditLogActorSession; - api_key?: AuditLogActorApiKey; + /** + * The type of actor. Is either `session` or `api_key`. + */ + type?: 'session' | 'api_key'; + session?: AuditLogActorSession; + api_key?: AuditLogActorApiKey; }; /** * The API Key used to perform the audit logged action. */ export type AuditLogActorApiKey = { - /** - * The tracking id of the API key. - */ - id?: string; - /** - * The type of API key. Can be either `user` or `service_account`. - */ - type?: 'user' | 'service_account'; - user?: AuditLogActorUser; - service_account?: AuditLogActorServiceAccount; + /** + * The tracking id of the API key. + */ + id?: string; + /** + * The type of API key. Can be either `user` or `service_account`. + */ + type?: 'user' | 'service_account'; + user?: AuditLogActorUser; + service_account?: AuditLogActorServiceAccount; }; /** * The service account that performed the audit logged action. */ export type AuditLogActorServiceAccount = { - /** - * The service account id. - */ - id?: string; + /** + * The service account id. + */ + id?: string; }; /** * The session in which the audit logged action was performed. */ export type AuditLogActorSession = { - user?: AuditLogActorUser; - /** - * The IP address from which the action was performed. - */ - ip_address?: string; + user?: AuditLogActorUser; + /** + * The IP address from which the action was performed. + */ + ip_address?: string; }; /** * The user who performed the audit logged action. */ export type AuditLogActorUser = { - /** - * The user id. - */ - id?: string; - /** - * The user email. - */ - email?: string; + /** + * The user id. + */ + id?: string; + /** + * The user email. + */ + email?: string; }; /** * The event type. */ export const AuditLogEventType = { - API_KEY_CREATED: 'api_key.created', - API_KEY_UPDATED: 'api_key.updated', - API_KEY_DELETED: 'api_key.deleted', - CHECKPOINT_PERMISSION_CREATED: 'checkpoint_permission.created', - CHECKPOINT_PERMISSION_DELETED: 'checkpoint_permission.deleted', - INVITE_SENT: 'invite.sent', - INVITE_ACCEPTED: 'invite.accepted', - INVITE_DELETED: 'invite.deleted', - LOGIN_SUCCEEDED: 'login.succeeded', - LOGIN_FAILED: 'login.failed', - LOGOUT_SUCCEEDED: 'logout.succeeded', - LOGOUT_FAILED: 'logout.failed', - ORGANIZATION_UPDATED: 'organization.updated', - PROJECT_CREATED: 'project.created', - PROJECT_UPDATED: 'project.updated', - PROJECT_ARCHIVED: 'project.archived', - SERVICE_ACCOUNT_CREATED: 'service_account.created', - SERVICE_ACCOUNT_UPDATED: 'service_account.updated', - SERVICE_ACCOUNT_DELETED: 'service_account.deleted', - RATE_LIMIT_UPDATED: 'rate_limit.updated', - RATE_LIMIT_DELETED: 'rate_limit.deleted', - USER_ADDED: 'user.added', - USER_UPDATED: 'user.updated', - USER_DELETED: 'user.deleted' + API_KEY_CREATED: 'api_key.created', + API_KEY_UPDATED: 'api_key.updated', + API_KEY_DELETED: 'api_key.deleted', + CHECKPOINT_PERMISSION_CREATED: 'checkpoint_permission.created', + CHECKPOINT_PERMISSION_DELETED: 'checkpoint_permission.deleted', + INVITE_SENT: 'invite.sent', + INVITE_ACCEPTED: 'invite.accepted', + INVITE_DELETED: 'invite.deleted', + LOGIN_SUCCEEDED: 'login.succeeded', + LOGIN_FAILED: 'login.failed', + LOGOUT_SUCCEEDED: 'logout.succeeded', + LOGOUT_FAILED: 'logout.failed', + ORGANIZATION_UPDATED: 'organization.updated', + PROJECT_CREATED: 'project.created', + PROJECT_UPDATED: 'project.updated', + PROJECT_ARCHIVED: 'project.archived', + SERVICE_ACCOUNT_CREATED: 'service_account.created', + SERVICE_ACCOUNT_UPDATED: 'service_account.updated', + SERVICE_ACCOUNT_DELETED: 'service_account.deleted', + RATE_LIMIT_UPDATED: 'rate_limit.updated', + RATE_LIMIT_DELETED: 'rate_limit.deleted', + USER_ADDED: 'user.added', + USER_UPDATED: 'user.updated', + USER_DELETED: 'user.deleted', } as const; /** * The event type. */ -export type AuditLogEventType = typeof AuditLogEventType[keyof typeof AuditLogEventType]; +export type AuditLogEventType = (typeof AuditLogEventType)[keyof typeof AuditLogEventType]; /** * Auto Chunking Strategy @@ -928,87 +956,95 @@ export type AuditLogEventType = typeof AuditLogEventType[keyof typeof AuditLogEv * The default strategy. This strategy currently uses a `max_chunk_size_tokens` of `800` and `chunk_overlap_tokens` of `400`. */ export type AutoChunkingStrategyRequestParam = { - /** - * Always `auto`. - */ - type: 'auto'; + /** + * Always `auto`. + */ + type: 'auto'; }; export type Batch = { - id: string; - /** - * The object type, which is always `batch`. - */ - object: 'batch'; - /** - * The OpenAI API endpoint used by the batch. - */ - endpoint: string; - errors?: { - /** - * The object type, which is always `list`. - */ - object?: string; - data?: Array; - }; - /** - * The ID of the input file for the batch. - */ - input_file_id: string; - /** - * The time frame within which the batch should be processed. - */ - completion_window: string; - /** - * The current status of the batch. - */ - status: 'validating' | 'failed' | 'in_progress' | 'finalizing' | 'completed' | 'expired' | 'cancelling' | 'cancelled'; - /** - * The ID of the file containing the outputs of successfully executed requests. - */ - output_file_id?: string; - /** - * The ID of the file containing the outputs of requests with errors. - */ - error_file_id?: string; - /** - * The Unix timestamp (in seconds) for when the batch was created. - */ - created_at: number; - /** - * The Unix timestamp (in seconds) for when the batch started processing. - */ - in_progress_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch will expire. - */ - expires_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch started finalizing. - */ - finalizing_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch was completed. - */ - completed_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch failed. - */ - failed_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch expired. - */ - expired_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch started cancelling. - */ - cancelling_at?: number; - /** - * The Unix timestamp (in seconds) for when the batch was cancelled. + id: string; + /** + * The object type, which is always `batch`. + */ + object: 'batch'; + /** + * The OpenAI API endpoint used by the batch. + */ + endpoint: string; + errors?: { + /** + * The object type, which is always `list`. */ - cancelled_at?: number; - request_counts?: BatchRequestCounts; - metadata?: Metadata; + object?: string; + data?: Array; + }; + /** + * The ID of the input file for the batch. + */ + input_file_id: string; + /** + * The time frame within which the batch should be processed. + */ + completion_window: string; + /** + * The current status of the batch. + */ + status: + | 'validating' + | 'failed' + | 'in_progress' + | 'finalizing' + | 'completed' + | 'expired' + | 'cancelling' + | 'cancelled'; + /** + * The ID of the file containing the outputs of successfully executed requests. + */ + output_file_id?: string; + /** + * The ID of the file containing the outputs of requests with errors. + */ + error_file_id?: string; + /** + * The Unix timestamp (in seconds) for when the batch was created. + */ + created_at: number; + /** + * The Unix timestamp (in seconds) for when the batch started processing. + */ + in_progress_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch will expire. + */ + expires_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch started finalizing. + */ + finalizing_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch was completed. + */ + completed_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch failed. + */ + failed_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch expired. + */ + expired_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch started cancelling. + */ + cancelling_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch was cancelled. + */ + cancelled_at?: number; + request_counts?: BatchRequestCounts; + metadata?: Metadata; }; /** @@ -1017,117 +1053,117 @@ export type Batch = { * The expiration policy for the output and/or error file that are generated for a batch. */ export type BatchFileExpirationAfter = { - /** - * Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. Note that the anchor is the file creation time, not the time the batch is created. - */ - anchor: 'created_at'; - /** - * The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). - */ - seconds: number; + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. Note that the anchor is the file creation time, not the time the batch is created. + */ + anchor: 'created_at'; + /** + * The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). + */ + seconds: number; }; /** * The per-line object of the batch input file */ export type BatchRequestInput = { - /** - * A developer-provided per-request id that will be used to match outputs to inputs. Must be unique for each request in a batch. - */ - custom_id?: string; - /** - * The HTTP method to be used for the request. Currently only `POST` is supported. - */ - method?: 'POST'; - /** - * The OpenAI API relative URL to be used for the request. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. - */ - url?: string; + /** + * A developer-provided per-request id that will be used to match outputs to inputs. Must be unique for each request in a batch. + */ + custom_id?: string; + /** + * The HTTP method to be used for the request. Currently only `POST` is supported. + */ + method?: 'POST'; + /** + * The OpenAI API relative URL to be used for the request. Currently `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` are supported. + */ + url?: string; }; /** * The per-line object of the batch output and error files */ export type BatchRequestOutput = { - id?: string; + id?: string; + /** + * A developer-provided per-request id that will be used to match outputs to inputs. + */ + custom_id?: string; + response?: { /** - * A developer-provided per-request id that will be used to match outputs to inputs. + * The HTTP status code of the response */ - custom_id?: string; - response?: { - /** - * The HTTP status code of the response - */ - status_code?: number; - /** - * An unique identifier for the OpenAI API request. Please include this request ID when contacting support. - */ - request_id?: string; - /** - * The JSON body of the response - */ - body?: { - [key: string]: unknown; - }; - }; + status_code?: number; /** - * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure. + * An unique identifier for the OpenAI API request. Please include this request ID when contacting support. */ - error?: { - /** - * A machine-readable error code. - */ - code?: string; - /** - * A human-readable error message. - */ - message?: string; + request_id?: string; + /** + * The JSON body of the response + */ + body?: { + [key: string]: unknown; }; + }; + /** + * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure. + */ + error?: { + /** + * A machine-readable error code. + */ + code?: string; + /** + * A human-readable error message. + */ + message?: string; + }; }; /** * Represents an individual `certificate` uploaded to the organization. */ export type Certificate = { - /** - * The object type. - * - * - If creating, updating, or getting a specific certificate, the object type is `certificate`. - * - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. - * - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. - * - */ - object: 'certificate' | 'organization.certificate' | 'organization.project.certificate'; - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - /** - * The name of the certificate. + /** + * The object type. + * + * - If creating, updating, or getting a specific certificate, the object type is `certificate`. + * - If listing, activating, or deactivating certificates for the organization, the object type is `organization.certificate`. + * - If listing, activating, or deactivating certificates for a project, the object type is `organization.project.certificate`. + * + */ + object: 'certificate' | 'organization.certificate' | 'organization.project.certificate'; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the certificate. + */ + name: string; + /** + * The Unix timestamp (in seconds) of when the certificate was uploaded. + */ + created_at: number; + certificate_details: { + /** + * The Unix timestamp (in seconds) of when the certificate becomes valid. + */ + valid_at?: number; + /** + * The Unix timestamp (in seconds) of when the certificate expires. */ - name: string; - /** - * The Unix timestamp (in seconds) of when the certificate was uploaded. - */ - created_at: number; - certificate_details: { - /** - * The Unix timestamp (in seconds) of when the certificate becomes valid. - */ - valid_at?: number; - /** - * The Unix timestamp (in seconds) of when the certificate expires. - */ - expires_at?: number; - /** - * The content of the certificate in PEM format. - */ - content?: string; - }; + expires_at?: number; /** - * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + * The content of the certificate in PEM format. */ - active?: boolean; + content?: string; + }; + /** + * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + */ + active?: boolean; }; /** @@ -1137,31 +1173,31 @@ export type Certificate = { * */ export type ChatCompletionAllowedTools = { - /** - * Constrains the tools available to the model to a pre-defined set. - * - * `auto` allows the model to pick from among the allowed tools and generate a - * message. - * - * `required` requires the model to call one or more of the allowed tools. - * - */ - mode: 'auto' | 'required'; - /** - * A list of tool definitions that the model should be allowed to call. - * - * For the Chat Completions API, the list of tool definitions might look like: - * ```json - * [ - * { "type": "function", "function": { "name": "get_weather" } }, - * { "type": "function", "function": { "name": "get_time" } } - * ] - * ``` - * - */ - tools: Array<{ - [key: string]: unknown; - }>; + /** + * Constrains the tools available to the model to a pre-defined set. + * + * `auto` allows the model to pick from among the allowed tools and generate a + * message. + * + * `required` requires the model to call one or more of the allowed tools. + * + */ + mode: 'auto' | 'required'; + /** + * A list of tool definitions that the model should be allowed to call. + * + * For the Chat Completions API, the list of tool definitions might look like: + * ```json + * [ + * { "type": "function", "function": { "name": "get_weather" } }, + * { "type": "function", "function": { "name": "get_time" } } + * ] + * ``` + * + */ + tools: Array<{ + [key: string]: unknown; + }>; }; /** @@ -1171,26 +1207,26 @@ export type ChatCompletionAllowedTools = { * */ export type ChatCompletionAllowedToolsChoice = { - /** - * Allowed tool configuration type. Always `allowed_tools`. - */ - type: 'allowed_tools'; - allowed_tools: ChatCompletionAllowedTools; + /** + * Allowed tool configuration type. Always `allowed_tools`. + */ + type: 'allowed_tools'; + allowed_tools: ChatCompletionAllowedTools; }; export type ChatCompletionDeleted = { - /** - * The type of object being deleted. - */ - object: 'chat.completion.deleted'; - /** - * The ID of the chat completion that was deleted. - */ - id: string; - /** - * Whether the chat completion was deleted. - */ - deleted: boolean; + /** + * The type of object being deleted. + */ + object: 'chat.completion.deleted'; + /** + * The ID of the chat completion that was deleted. + */ + id: string; + /** + * Whether the chat completion was deleted. + */ + deleted: boolean; }; /** @@ -1198,25 +1234,25 @@ export type ChatCompletionDeleted = { * */ export type ChatCompletionFunctionCallOption = { - /** - * The name of the function to call. - */ - name: string; + /** + * The name of the function to call. + */ + name: string; }; /** * @deprecated */ export type ChatCompletionFunctions = { - /** - * A description of what the function does, used by the model to choose when and how to call the function. - */ - description?: string; - /** - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - */ - name: string; - parameters?: FunctionParameters; + /** + * A description of what the function does, used by the model to choose when and how to call the function. + */ + description?: string; + /** + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + */ + name: string; + parameters?: FunctionParameters; }; /** @@ -1226,28 +1262,28 @@ export type ChatCompletionFunctions = { * */ export type ChatCompletionList = { - /** - * The type of this object. It is always set to "list". - * - */ - object: 'list'; - /** - * An array of chat completion objects. - * - */ - data: Array; - /** - * The identifier of the first chat completion in the data array. - */ - first_id: string; - /** - * The identifier of the last chat completion in the data array. - */ - last_id: string; - /** - * Indicates whether there are more Chat Completions available. - */ - has_more: boolean; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; + /** + * An array of chat completion objects. + * + */ + data: Array; + /** + * The identifier of the first chat completion in the data array. + */ + first_id: string; + /** + * The identifier of the last chat completion in the data array. + */ + last_id: string; + /** + * Indicates whether there are more Chat Completions available. + */ + has_more: boolean; }; /** @@ -1257,27 +1293,27 @@ export type ChatCompletionList = { * */ export type ChatCompletionMessageCustomToolCall = { + /** + * The ID of the tool call. + */ + id: string; + /** + * The type of the tool. Always `custom`. + */ + type: 'custom'; + /** + * The custom tool that the model called. + */ + custom: { /** - * The ID of the tool call. - */ - id: string; - /** - * The type of the tool. Always `custom`. + * The name of the custom tool to call. */ - type: 'custom'; + name: string; /** - * The custom tool that the model called. + * The input for the custom tool call generated by the model. */ - custom: { - /** - * The name of the custom tool to call. - */ - name: string; - /** - * The input for the custom tool call generated by the model. - */ - input: string; - }; + input: string; + }; }; /** @@ -1287,39 +1323,43 @@ export type ChatCompletionMessageCustomToolCall = { * */ export type ChatCompletionMessageList = { - /** - * The type of this object. It is always set to "list". - * - */ - object: 'list'; - /** - * An array of chat completion message objects. - * - */ - data: Array; - }>; - /** - * The identifier of the first chat message in the data array. - */ - first_id: string; - /** - * The identifier of the last chat message in the data array. - */ - last_id: string; - /** - * Indicates whether there are more chat messages available. - */ - has_more: boolean; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; + /** + * An array of chat completion message objects. + * + */ + data: Array< + ChatCompletionResponseMessage & { + /** + * The identifier of the chat message. + */ + id: string; + /** + * If a content parts array was provided, this is an array of `text` and `image_url` parts. + * Otherwise, null. + * + */ + content_parts?: Array< + ChatCompletionRequestMessageContentPartText | ChatCompletionRequestMessageContentPartImage + >; + } + >; + /** + * The identifier of the first chat message in the data array. + */ + first_id: string; + /** + * The identifier of the last chat message in the data array. + */ + last_id: string; + /** + * Indicates whether there are more chat messages available. + */ + has_more: boolean; }; /** @@ -1329,59 +1369,62 @@ export type ChatCompletionMessageList = { * */ export type ChatCompletionMessageToolCall = { + /** + * The ID of the tool call. + */ + id: string; + /** + * The type of the tool. Currently, only `function` is supported. + */ + type: 'function'; + /** + * The function that the model called. + */ + function: { /** - * The ID of the tool call. - */ - id: string; - /** - * The type of the tool. Currently, only `function` is supported. + * The name of the function to call. */ - type: 'function'; + name: string; /** - * The function that the model called. + * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. */ - function: { - /** - * The name of the function to call. - */ - name: string; - /** - * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - */ - arguments: string; - }; + arguments: string; + }; }; export type ChatCompletionMessageToolCallChunk = { - index: number; + index: number; + /** + * The ID of the tool call. + */ + id?: string; + /** + * The type of the tool. Currently, only `function` is supported. + */ + type?: 'function'; + function?: { /** - * The ID of the tool call. + * The name of the function to call. */ - id?: string; + name?: string; /** - * The type of the tool. Currently, only `function` is supported. + * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. */ - type?: 'function'; - function?: { - /** - * The name of the function to call. - */ - name?: string; - /** - * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - */ - arguments?: string; - }; + arguments?: string; + }; }; /** * The tool calls generated by the model, such as function calls. */ -export type ChatCompletionMessageToolCalls = Array<({ - type?: 'ChatCompletionMessageToolCall'; -} & ChatCompletionMessageToolCall) | ({ - type?: 'ChatCompletionMessageCustomToolCall'; -} & ChatCompletionMessageCustomToolCall)>; +export type ChatCompletionMessageToolCalls = Array< + | ({ + type?: 'ChatCompletionMessageToolCall'; + } & ChatCompletionMessageToolCall) + | ({ + type?: 'ChatCompletionMessageCustomToolCall'; + } & ChatCompletionMessageCustomToolCall) +>; /** * Output types that you would like the model to generate for this request. @@ -1404,16 +1447,16 @@ export type ChatCompletionModalities = Array<'text' | 'audio'>; * Specifies a tool the model should use. Use to force the model to call a specific function. */ export type ChatCompletionNamedToolChoice = { + /** + * For function calling, the type is always `function`. + */ + type: 'function'; + function: { /** - * For function calling, the type is always `function`. + * The name of the function to call. */ - type: 'function'; - function: { - /** - * The name of the function to call. - */ - name: string; - }; + name: string; + }; }; /** @@ -1422,16 +1465,16 @@ export type ChatCompletionNamedToolChoice = { * Specifies a tool the model should use. Use to force the model to call a specific custom tool. */ export type ChatCompletionNamedToolChoiceCustom = { + /** + * For custom tool calling, the type is always `custom`. + */ + type: 'custom'; + custom: { /** - * For custom tool calling, the type is always `custom`. + * The name of the custom tool to call. */ - type: 'custom'; - custom: { - /** - * The name of the custom tool to call. - */ - name: string; - }; + name: string; + }; }; /** @@ -1441,58 +1484,60 @@ export type ChatCompletionNamedToolChoiceCustom = { * */ export type ChatCompletionRequestAssistantMessage = { - /** - * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + /** + * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + * + */ + content?: string | Array; + /** + * The refusal message by the assistant. + */ + refusal?: string; + /** + * The role of the messages author, in this case `assistant`. + */ + role: 'assistant'; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; + /** + * Data about a previous audio response from the model. + * [Learn more](https://platform.openai.com/docs/guides/audio). + * + */ + audio?: { + /** + * Unique identifier for a previous audio response from the model. * */ - content?: string | Array; - /** - * The refusal message by the assistant. - */ - refusal?: string; - /** - * The role of the messages author, in this case `assistant`. - */ - role: 'assistant'; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; + id: string; + }; + tool_calls?: ChatCompletionMessageToolCalls; + /** + * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + * + * @deprecated + */ + function_call?: { /** - * Data about a previous audio response from the model. - * [Learn more](https://platform.openai.com/docs/guides/audio). - * + * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. */ - audio?: { - /** - * Unique identifier for a previous audio response from the model. - * - */ - id: string; - }; - tool_calls?: ChatCompletionMessageToolCalls; + arguments: string; /** - * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. - * - * @deprecated + * The name of the function to call. */ - function_call?: { - /** - * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - */ - arguments: string; - /** - * The name of the function to call. - */ - name: string; - }; + name: string; + }; }; -export type ChatCompletionRequestAssistantMessageContentPart = ({ - type?: 'ChatCompletionRequestMessageContentPartText'; -} & ChatCompletionRequestMessageContentPartText) | ({ - type?: 'ChatCompletionRequestMessageContentPartRefusal'; -} & ChatCompletionRequestMessageContentPartRefusal); +export type ChatCompletionRequestAssistantMessageContentPart = + | ({ + type?: 'ChatCompletionRequestMessageContentPartText'; + } & ChatCompletionRequestMessageContentPartText) + | ({ + type?: 'ChatCompletionRequestMessageContentPartRefusal'; + } & ChatCompletionRequestMessageContentPartRefusal); /** * Developer message @@ -1503,18 +1548,18 @@ export type ChatCompletionRequestAssistantMessageContentPart = ({ * */ export type ChatCompletionRequestDeveloperMessage = { - /** - * The contents of the developer message. - */ - content: string | Array; - /** - * The role of the messages author, in this case `developer`. - */ - role: 'developer'; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; + /** + * The contents of the developer message. + */ + content: string | Array; + /** + * The role of the messages author, in this case `developer`. + */ + role: 'developer'; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; }; /** @@ -1523,33 +1568,39 @@ export type ChatCompletionRequestDeveloperMessage = { * @deprecated */ export type ChatCompletionRequestFunctionMessage = { - /** - * The role of the messages author, in this case `function`. - */ - role: 'function'; - /** - * The contents of the function message. - */ - content: string; - /** - * The name of the function to call. - */ - name: string; -}; - -export type ChatCompletionRequestMessage = ({ - role?: 'ChatCompletionRequestDeveloperMessage'; -} & ChatCompletionRequestDeveloperMessage) | ({ - role?: 'ChatCompletionRequestSystemMessage'; -} & ChatCompletionRequestSystemMessage) | ({ - role?: 'ChatCompletionRequestUserMessage'; -} & ChatCompletionRequestUserMessage) | ({ - role?: 'ChatCompletionRequestAssistantMessage'; -} & ChatCompletionRequestAssistantMessage) | ({ - role?: 'ChatCompletionRequestToolMessage'; -} & ChatCompletionRequestToolMessage) | ({ - role?: 'ChatCompletionRequestFunctionMessage'; -} & ChatCompletionRequestFunctionMessage); + /** + * The role of the messages author, in this case `function`. + */ + role: 'function'; + /** + * The contents of the function message. + */ + content: string; + /** + * The name of the function to call. + */ + name: string; +}; + +export type ChatCompletionRequestMessage = + | ({ + role?: 'ChatCompletionRequestDeveloperMessage'; + } & ChatCompletionRequestDeveloperMessage) + | ({ + role?: 'ChatCompletionRequestSystemMessage'; + } & ChatCompletionRequestSystemMessage) + | ({ + role?: 'ChatCompletionRequestUserMessage'; + } & ChatCompletionRequestUserMessage) + | ({ + role?: 'ChatCompletionRequestAssistantMessage'; + } & ChatCompletionRequestAssistantMessage) + | ({ + role?: 'ChatCompletionRequestToolMessage'; + } & ChatCompletionRequestToolMessage) + | ({ + role?: 'ChatCompletionRequestFunctionMessage'; + } & ChatCompletionRequestFunctionMessage); /** * Audio content part @@ -1558,21 +1609,21 @@ export type ChatCompletionRequestMessage = ({ * */ export type ChatCompletionRequestMessageContentPartAudio = { + /** + * The type of the content part. Always `input_audio`. + */ + type: 'input_audio'; + input_audio: { /** - * The type of the content part. Always `input_audio`. + * Base64 encoded audio data. */ - type: 'input_audio'; - input_audio: { - /** - * Base64 encoded audio data. - */ - data: string; - /** - * The format of the encoded audio data. Currently supports "wav" and "mp3". - * - */ - format: 'wav' | 'mp3'; - }; + data: string; + /** + * The format of the encoded audio data. Currently supports "wav" and "mp3". + * + */ + format: 'wav' | 'mp3'; + }; }; /** @@ -1582,29 +1633,29 @@ export type ChatCompletionRequestMessageContentPartAudio = { * */ export type ChatCompletionRequestMessageContentPartFile = { + /** + * The type of the content part. Always `file`. + */ + type: 'file'; + file: { /** - * The type of the content part. Always `file`. + * The name of the file, used when passing the file to the model as a + * string. + * */ - type: 'file'; - file: { - /** - * The name of the file, used when passing the file to the model as a - * string. - * - */ - filename?: string; - /** - * The base64 encoded file data, used when passing the file to the model - * as a string. - * - */ - file_data?: string; - /** - * The ID of an uploaded file to use as input. - * - */ - file_id?: string; - }; + filename?: string; + /** + * The base64 encoded file data, used when passing the file to the model + * as a string. + * + */ + file_data?: string; + /** + * The ID of an uploaded file to use as input. + * + */ + file_id?: string; + }; }; /** @@ -1614,34 +1665,34 @@ export type ChatCompletionRequestMessageContentPartFile = { * */ export type ChatCompletionRequestMessageContentPartImage = { + /** + * The type of the content part. + */ + type: 'image_url'; + image_url: { /** - * The type of the content part. + * Either a URL of the image or the base64 encoded image data. */ - type: 'image_url'; - image_url: { - /** - * Either a URL of the image or the base64 encoded image data. - */ - url: string; - /** - * Specifies the detail level of the image. Learn more in the [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). - */ - detail?: 'auto' | 'low' | 'high'; - }; + url: string; + /** + * Specifies the detail level of the image. Learn more in the [Vision guide](https://platform.openai.com/docs/guides/vision#low-or-high-fidelity-image-understanding). + */ + detail?: 'auto' | 'low' | 'high'; + }; }; /** * Refusal content part */ export type ChatCompletionRequestMessageContentPartRefusal = { - /** - * The type of the content part. - */ - type: 'refusal'; - /** - * The refusal message generated by the model. - */ - refusal: string; + /** + * The type of the content part. + */ + type: 'refusal'; + /** + * The refusal message generated by the model. + */ + refusal: string; }; /** @@ -1651,14 +1702,14 @@ export type ChatCompletionRequestMessageContentPartRefusal = { * */ export type ChatCompletionRequestMessageContentPartText = { - /** - * The type of the content part. - */ - type: 'text'; - /** - * The text content. - */ - text: string; + /** + * The type of the content part. + */ + type: 'text'; + /** + * The text content. + */ + text: string; }; /** @@ -1670,41 +1721,43 @@ export type ChatCompletionRequestMessageContentPartText = { * */ export type ChatCompletionRequestSystemMessage = { - /** - * The contents of the system message. - */ - content: string | Array; - /** - * The role of the messages author, in this case `system`. - */ - role: 'system'; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; + /** + * The contents of the system message. + */ + content: string | Array; + /** + * The role of the messages author, in this case `system`. + */ + role: 'system'; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; }; -export type ChatCompletionRequestSystemMessageContentPart = ChatCompletionRequestMessageContentPartText; +export type ChatCompletionRequestSystemMessageContentPart = + ChatCompletionRequestMessageContentPartText; /** * Tool message */ export type ChatCompletionRequestToolMessage = { - /** - * The role of the messages author, in this case `tool`. - */ - role: 'tool'; - /** - * The contents of the tool message. - */ - content: string | Array; - /** - * Tool call that this message is responding to. - */ - tool_call_id: string; + /** + * The role of the messages author, in this case `tool`. + */ + role: 'tool'; + /** + * The contents of the tool message. + */ + content: string | Array; + /** + * Tool call that this message is responding to. + */ + tool_call_id: string; }; -export type ChatCompletionRequestToolMessageContentPart = ChatCompletionRequestMessageContentPartText; +export type ChatCompletionRequestToolMessageContentPart = + ChatCompletionRequestMessageContentPartText; /** * User message @@ -1714,207 +1767,227 @@ export type ChatCompletionRequestToolMessageContentPart = ChatCompletionRequestM * */ export type ChatCompletionRequestUserMessage = { - /** - * The contents of the user message. - * - */ - content: string | Array; - /** - * The role of the messages author, in this case `user`. - */ - role: 'user'; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; -}; - -export type ChatCompletionRequestUserMessageContentPart = ({ - type?: 'ChatCompletionRequestMessageContentPartText'; -} & ChatCompletionRequestMessageContentPartText) | ({ - type?: 'ChatCompletionRequestMessageContentPartImage'; -} & ChatCompletionRequestMessageContentPartImage) | ({ - type?: 'ChatCompletionRequestMessageContentPartAudio'; -} & ChatCompletionRequestMessageContentPartAudio) | ({ - type?: 'ChatCompletionRequestMessageContentPartFile'; -} & ChatCompletionRequestMessageContentPartFile); + /** + * The contents of the user message. + * + */ + content: string | Array; + /** + * The role of the messages author, in this case `user`. + */ + role: 'user'; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; +}; + +export type ChatCompletionRequestUserMessageContentPart = + | ({ + type?: 'ChatCompletionRequestMessageContentPartText'; + } & ChatCompletionRequestMessageContentPartText) + | ({ + type?: 'ChatCompletionRequestMessageContentPartImage'; + } & ChatCompletionRequestMessageContentPartImage) + | ({ + type?: 'ChatCompletionRequestMessageContentPartAudio'; + } & ChatCompletionRequestMessageContentPartAudio) + | ({ + type?: 'ChatCompletionRequestMessageContentPartFile'; + } & ChatCompletionRequestMessageContentPartFile); /** * A chat completion message generated by the model. */ export type ChatCompletionResponseMessage = { + /** + * The contents of the message. + */ + content: string; + /** + * The refusal message generated by the model. + */ + refusal: string; + tool_calls?: ChatCompletionMessageToolCalls; + /** + * Annotations for the message, when applicable, as when using the + * [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). + * + */ + annotations?: Array<{ /** - * The contents of the message. + * The type of the URL citation. Always `url_citation`. */ - content: string; + type: 'url_citation'; /** - * The refusal message generated by the model. + * A URL citation when using web search. + */ + url_citation: { + /** + * The index of the last character of the URL citation in the message. + */ + end_index: number; + /** + * The index of the first character of the URL citation in the message. + */ + start_index: number; + /** + * The URL of the web resource. + */ + url: string; + /** + * The title of the web resource. + */ + title: string; + }; + }>; + /** + * The role of the author of this message. + */ + role: 'assistant'; + /** + * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + * + * @deprecated + */ + function_call?: { + /** + * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. */ - refusal: string; - tool_calls?: ChatCompletionMessageToolCalls; + arguments: string; /** - * Annotations for the message, when applicable, as when using the - * [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). - * + * The name of the function to call. */ - annotations?: Array<{ - /** - * The type of the URL citation. Always `url_citation`. - */ - type: 'url_citation'; - /** - * A URL citation when using web search. - */ - url_citation: { - /** - * The index of the last character of the URL citation in the message. - */ - end_index: number; - /** - * The index of the first character of the URL citation in the message. - */ - start_index: number; - /** - * The URL of the web resource. - */ - url: string; - /** - * The title of the web resource. - */ - title: string; - }; - }>; + name: string; + }; + /** + * If the audio output modality is requested, this object contains data + * about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio). + * + */ + audio?: { /** - * The role of the author of this message. + * Unique identifier for this audio response. */ - role: 'assistant'; + id: string; /** - * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + * The Unix timestamp (in seconds) for when this audio response will + * no longer be accessible on the server for use in multi-turn + * conversations. * - * @deprecated */ - function_call?: { - /** - * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - */ - arguments: string; - /** - * The name of the function to call. - */ - name: string; - }; + expires_at: number; /** - * If the audio output modality is requested, this object contains data - * about the audio response from the model. [Learn more](https://platform.openai.com/docs/guides/audio). + * Base64 encoded audio bytes generated by the model, in the format + * specified in the request. * */ - audio?: { - /** - * Unique identifier for this audio response. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when this audio response will - * no longer be accessible on the server for use in multi-turn - * conversations. - * - */ - expires_at: number; - /** - * Base64 encoded audio bytes generated by the model, in the format - * specified in the request. - * - */ - data: string; - /** - * Transcript of the audio generated by the model. - */ - transcript: string; - }; + data: string; + /** + * Transcript of the audio generated by the model. + */ + transcript: string; + }; }; /** * The role of the author of a message */ export const ChatCompletionRole = { - DEVELOPER: 'developer', - SYSTEM: 'system', - USER: 'user', - ASSISTANT: 'assistant', - TOOL: 'tool', - FUNCTION: 'function' + DEVELOPER: 'developer', + SYSTEM: 'system', + USER: 'user', + ASSISTANT: 'assistant', + TOOL: 'tool', + FUNCTION: 'function', } as const; /** * The role of the author of a message */ -export type ChatCompletionRole = typeof ChatCompletionRole[keyof typeof ChatCompletionRole]; +export type ChatCompletionRole = (typeof ChatCompletionRole)[keyof typeof ChatCompletionRole]; /** * Options for streaming response. Only set this when you set `stream: true`. * */ export type ChatCompletionStreamOptions = { - /** - * If set, an additional chunk will be streamed before the `data: [DONE]` - * message. The `usage` field on this chunk shows the token usage statistics - * for the entire request, and the `choices` field will always be an empty - * array. - * - * All other chunks will also include a `usage` field, but with a null - * value. **NOTE:** If the stream is interrupted, you may not receive the - * final usage chunk which contains the total token usage for the request. - * - */ - include_usage?: boolean; - /** - * When true, stream obfuscation will be enabled. Stream obfuscation adds - * random characters to an `obfuscation` field on streaming delta events to - * normalize payload sizes as a mitigation to certain side-channel attacks. - * These obfuscation fields are included by default, but add a small amount - * of overhead to the data stream. You can set `include_obfuscation` to - * false to optimize for bandwidth if you trust the network links between - * your application and the OpenAI API. - * - */ - include_obfuscation?: boolean; + /** + * If set, an additional chunk will be streamed before the `data: [DONE]` + * message. The `usage` field on this chunk shows the token usage statistics + * for the entire request, and the `choices` field will always be an empty + * array. + * + * All other chunks will also include a `usage` field, but with a null + * value. **NOTE:** If the stream is interrupted, you may not receive the + * final usage chunk which contains the total token usage for the request. + * + */ + include_usage?: boolean; + /** + * When true, stream obfuscation will be enabled. Stream obfuscation adds + * random characters to an `obfuscation` field on streaming delta events to + * normalize payload sizes as a mitigation to certain side-channel attacks. + * These obfuscation fields are included by default, but add a small amount + * of overhead to the data stream. You can set `include_obfuscation` to + * false to optimize for bandwidth if you trust the network links between + * your application and the OpenAI API. + * + */ + include_obfuscation?: boolean; }; /** * A chat completion delta generated by streamed model responses. */ export type ChatCompletionStreamResponseDelta = { - /** - * The contents of the chunk message. - */ - content?: string; - /** - * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. - * - * @deprecated - */ - function_call?: { - /** - * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. - */ - arguments?: string; - /** - * The name of the function to call. - */ - name?: string; - }; - tool_calls?: Array; - /** - * The role of the author of this message. + /** + * The contents of the chunk message. + */ + content?: string; + /** + * Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model. + * + * @deprecated + */ + function_call?: { + /** + * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. */ - role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool'; + arguments?: string; /** - * The refusal message generated by the model. + * The name of the function to call. */ - refusal?: string; + name?: string; + }; + tool_calls?: Array; + /** + * The role of the author of this message. + */ + role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool'; + /** + * The refusal message generated by the model. + */ + refusal?: string; }; export type ChatCompletionTokenLogprob = { + /** + * The token. + */ + token: string; + /** + * The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely. + */ + logprob: number; + /** + * A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. + */ + bytes: Array; + /** + * List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. + */ + top_logprobs: Array<{ /** * The token. */ @@ -1927,23 +2000,7 @@ export type ChatCompletionTokenLogprob = { * A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. */ bytes: Array; - /** - * List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested `top_logprobs` returned. - */ - top_logprobs: Array<{ - /** - * The token. - */ - token: string; - /** - * The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value `-9999.0` is used to signify that the token is very unlikely. - */ - logprob: number; - /** - * A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be `null` if there is no bytes representation for the token. - */ - bytes: Array; - }>; + }>; }; /** @@ -1953,11 +2010,11 @@ export type ChatCompletionTokenLogprob = { * */ export type ChatCompletionTool = { - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; - function: FunctionObject; + /** + * The type of the tool. Currently, only `function` is supported. + */ + type: 'function'; + function: FunctionObject; }; /** @@ -1970,16 +2027,24 @@ export type ChatCompletionTool = { * `none` is the default when no tools are present. `auto` is the default if tools are present. * */ -export type ChatCompletionToolChoiceOption = 'none' | 'auto' | 'required' | ChatCompletionAllowedToolsChoice | ChatCompletionNamedToolChoice | ChatCompletionNamedToolChoiceCustom; +export type ChatCompletionToolChoiceOption = + | 'none' + | 'auto' + | 'required' + | ChatCompletionAllowedToolsChoice + | ChatCompletionNamedToolChoice + | ChatCompletionNamedToolChoiceCustom; /** * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. Only applicable if `file_ids` is non-empty. */ -export type ChunkingStrategyRequestParam = ({ - type?: 'AutoChunkingStrategyRequestParam'; -} & AutoChunkingStrategyRequestParam) | ({ - type?: 'StaticChunkingStrategyRequestParam'; -} & StaticChunkingStrategyRequestParam); +export type ChunkingStrategyRequestParam = + | ({ + type?: 'AutoChunkingStrategyRequestParam'; + } & AutoChunkingStrategyRequestParam) + | ({ + type?: 'StaticChunkingStrategyRequestParam'; + } & StaticChunkingStrategyRequestParam); /** * Click @@ -1988,27 +2053,27 @@ export type ChunkingStrategyRequestParam = ({ * */ export type Click = { - /** - * Specifies the event type. For a click action, this property is - * always set to `click`. - * - */ - type: 'click'; - /** - * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. - * - */ - button: 'left' | 'right' | 'wheel' | 'back' | 'forward'; - /** - * The x-coordinate where the click occurred. - * - */ - x: number; - /** - * The y-coordinate where the click occurred. - * - */ - y: number; + /** + * Specifies the event type. For a click action, this property is + * always set to `click`. + * + */ + type: 'click'; + /** + * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + * + */ + button: 'left' | 'right' | 'wheel' | 'back' | 'forward'; + /** + * The x-coordinate where the click occurred. + * + */ + x: number; + /** + * The y-coordinate where the click occurred. + * + */ + y: number; }; /** @@ -2018,23 +2083,23 @@ export type Click = { * */ export type CodeInterpreterFileOutput = { + /** + * The type of the code interpreter file output. Always `files`. + * + */ + type: 'files'; + files: Array<{ /** - * The type of the code interpreter file output. Always `files`. + * The MIME type of the file. * */ - type: 'files'; - files: Array<{ - /** - * The MIME type of the file. - * - */ - mime_type: string; - /** - * The ID of the file. - * - */ - file_id: string; - }>; + mime_type: string; + /** + * The ID of the file. + * + */ + file_id: string; + }>; }; /** @@ -2044,14 +2109,14 @@ export type CodeInterpreterFileOutput = { * */ export type CodeInterpreterOutputImage = { - /** - * The type of the output. Always 'image'. - */ - type: 'image'; - /** - * The URL of the image output from the code interpreter. - */ - url: string; + /** + * The type of the output. Always 'image'. + */ + type: 'image'; + /** + * The URL of the image output from the code interpreter. + */ + url: string; }; /** @@ -2061,14 +2126,14 @@ export type CodeInterpreterOutputImage = { * */ export type CodeInterpreterOutputLogs = { - /** - * The type of the output. Always 'logs'. - */ - type: 'logs'; - /** - * The logs output from the code interpreter. - */ - logs: string; + /** + * The type of the output. Always 'logs'. + */ + type: 'logs'; + /** + * The logs output from the code interpreter. + */ + logs: string; }; /** @@ -2078,16 +2143,16 @@ export type CodeInterpreterOutputLogs = { * */ export type CodeInterpreterTextOutput = { - /** - * The type of the code interpreter text output. Always `logs`. - * - */ - type: 'logs'; - /** - * The logs of the code interpreter tool call. - * - */ - logs: string; + /** + * The type of the code interpreter text output. Always `logs`. + * + */ + type: 'logs'; + /** + * The logs of the code interpreter tool call. + * + */ + logs: string; }; /** @@ -2097,17 +2162,17 @@ export type CodeInterpreterTextOutput = { * */ export type CodeInterpreterTool = { - /** - * The type of the code interpreter tool. Always `code_interpreter`. - * - */ - type: 'code_interpreter'; - /** - * The code interpreter container. Can be a container ID or an object that - * specifies uploaded file IDs to make available to your code. - * - */ - container: string | CodeInterpreterToolAuto; + /** + * The type of the code interpreter tool. Always `code_interpreter`. + * + */ + type: 'code_interpreter'; + /** + * The code interpreter container. Can be a container ID or an object that + * specifies uploaded file IDs to make available to your code. + * + */ + container: string | CodeInterpreterToolAuto; }; /** @@ -2118,15 +2183,15 @@ export type CodeInterpreterTool = { * */ export type CodeInterpreterToolAuto = { - /** - * Always `auto`. - */ - type: 'auto'; - /** - * An optional list of uploaded files to make available to your code. - * - */ - file_ids?: Array; + /** + * Always `auto`. + */ + type: 'auto'; + /** + * An optional list of uploaded files to make available to your code. + * + */ + file_ids?: Array; }; /** @@ -2136,41 +2201,44 @@ export type CodeInterpreterToolAuto = { * */ export type CodeInterpreterToolCall = { - /** - * The type of the code interpreter tool call. Always `code_interpreter_call`. - * - */ - type: 'code_interpreter_call'; - /** - * The unique ID of the code interpreter tool call. - * - */ - id: string; - /** - * The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. - * - */ - status: 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed'; - /** - * The ID of the container used to run the code. - * - */ - container_id: string; - /** - * The code to run, or null if not available. - * - */ - code: string; - /** - * The outputs generated by the code interpreter, such as logs or images. - * Can be null if no outputs are available. - * - */ - outputs: Array<({ + /** + * The type of the code interpreter tool call. Always `code_interpreter_call`. + * + */ + type: 'code_interpreter_call'; + /** + * The unique ID of the code interpreter tool call. + * + */ + id: string; + /** + * The status of the code interpreter tool call. Valid values are `in_progress`, `completed`, `incomplete`, `interpreting`, and `failed`. + * + */ + status: 'in_progress' | 'completed' | 'incomplete' | 'interpreting' | 'failed'; + /** + * The ID of the container used to run the code. + * + */ + container_id: string; + /** + * The code to run, or null if not available. + * + */ + code: string; + /** + * The outputs generated by the code interpreter, such as logs or images. + * Can be null if no outputs are available. + * + */ + outputs: Array< + | ({ type?: 'CodeInterpreterOutputLogs'; - } & CodeInterpreterOutputLogs) | ({ + } & CodeInterpreterOutputLogs) + | ({ type?: 'CodeInterpreterOutputImage'; - } & CodeInterpreterOutputImage)>; + } & CodeInterpreterOutputImage) + >; }; /** @@ -2180,97 +2248,97 @@ export type CodeInterpreterToolCall = { * */ export type ComparisonFilter = { - /** - * Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. - * - `eq`: equals - * - `ne`: not equal - * - `gt`: greater than - * - `gte`: greater than or equal - * - `lt`: less than - * - `lte`: less than or equal - * - */ - type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte'; - /** - * The key to compare against the value. - */ - key: string; - /** - * The value to compare against the attribute key; supports string, number, or boolean types. - */ - value: string | number | boolean; + /** + * Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. + * - `eq`: equals + * - `ne`: not equal + * - `gt`: greater than + * - `gte`: greater than or equal + * - `lt`: less than + * - `lte`: less than or equal + * + */ + type: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte'; + /** + * The key to compare against the value. + */ + key: string; + /** + * The value to compare against the attribute key; supports string, number, or boolean types. + */ + value: string | number | boolean; }; export type CompleteUploadRequest = { - /** - * The ordered list of Part IDs. - * - */ - part_ids: Array; - /** - * The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect. - * - */ - md5?: string; + /** + * The ordered list of Part IDs. + * + */ + part_ids: Array; + /** + * The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect. + * + */ + md5?: string; }; /** * Usage statistics for the completion request. */ export type CompletionUsage = { + /** + * Number of tokens in the generated completion. + */ + completion_tokens: number; + /** + * Number of tokens in the prompt. + */ + prompt_tokens: number; + /** + * Total number of tokens used in the request (prompt + completion). + */ + total_tokens: number; + /** + * Breakdown of tokens used in a completion. + */ + completion_tokens_details?: { /** - * Number of tokens in the generated completion. + * When using Predicted Outputs, the number of tokens in the + * prediction that appeared in the completion. + * */ - completion_tokens: number; + accepted_prediction_tokens?: number; /** - * Number of tokens in the prompt. + * Audio input tokens generated by the model. */ - prompt_tokens: number; + audio_tokens?: number; /** - * Total number of tokens used in the request (prompt + completion). + * Tokens generated by the model for reasoning. */ - total_tokens: number; + reasoning_tokens?: number; /** - * Breakdown of tokens used in a completion. + * When using Predicted Outputs, the number of tokens in the + * prediction that did not appear in the completion. However, like + * reasoning tokens, these tokens are still counted in the total + * completion tokens for purposes of billing, output, and context window + * limits. + * */ - completion_tokens_details?: { - /** - * When using Predicted Outputs, the number of tokens in the - * prediction that appeared in the completion. - * - */ - accepted_prediction_tokens?: number; - /** - * Audio input tokens generated by the model. - */ - audio_tokens?: number; - /** - * Tokens generated by the model for reasoning. - */ - reasoning_tokens?: number; - /** - * When using Predicted Outputs, the number of tokens in the - * prediction that did not appear in the completion. However, like - * reasoning tokens, these tokens are still counted in the total - * completion tokens for purposes of billing, output, and context window - * limits. - * - */ - rejected_prediction_tokens?: number; - }; + rejected_prediction_tokens?: number; + }; + /** + * Breakdown of tokens used in the prompt. + */ + prompt_tokens_details?: { /** - * Breakdown of tokens used in the prompt. + * Audio input tokens present in the prompt. */ - prompt_tokens_details?: { - /** - * Audio input tokens present in the prompt. - */ - audio_tokens?: number; - /** - * Cached tokens present in the prompt. - */ - cached_tokens?: number; - }; + audio_tokens?: number; + /** + * Cached tokens present in the prompt. + */ + cached_tokens?: number; + }; }; /** @@ -2279,55 +2347,64 @@ export type CompletionUsage = { * Combine multiple filters using `and` or `or`. */ export type CompoundFilter = { - /** - * Type of operation: `and` or `or`. - */ - type: 'and' | 'or'; - /** - * Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - */ - filters: Array; -}; - -export type ComputerAction = ({ - type?: 'Click'; -} & Click) | ({ - type?: 'DoubleClick'; -} & DoubleClick) | ({ - type?: 'Drag'; -} & Drag) | ({ - type?: 'KeyPress'; -} & KeyPress) | ({ - type?: 'Move'; -} & Move) | ({ - type?: 'Screenshot'; -} & Screenshot) | ({ - type?: 'Scroll'; -} & Scroll) | ({ - type?: 'Type'; -} & Type) | ({ - type?: 'Wait'; -} & Wait); + /** + * Type of operation: `and` or `or`. + */ + type: 'and' | 'or'; + /** + * Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + */ + filters: Array; +}; + +export type ComputerAction = + | ({ + type?: 'Click'; + } & Click) + | ({ + type?: 'DoubleClick'; + } & DoubleClick) + | ({ + type?: 'Drag'; + } & Drag) + | ({ + type?: 'KeyPress'; + } & KeyPress) + | ({ + type?: 'Move'; + } & Move) + | ({ + type?: 'Screenshot'; + } & Screenshot) + | ({ + type?: 'Scroll'; + } & Scroll) + | ({ + type?: 'Type'; + } & Type) + | ({ + type?: 'Wait'; + } & Wait); /** * A computer screenshot image used with the computer use tool. * */ export type ComputerScreenshotImage = { - /** - * Specifies the event type. For a computer screenshot, this property is - * always set to `computer_screenshot`. - * - */ - type: 'computer_screenshot'; - /** - * The URL of the screenshot image. - */ - image_url?: string; - /** - * The identifier of an uploaded file that contains the screenshot. - */ - file_id?: string; + /** + * Specifies the event type. For a computer screenshot, this property is + * always set to `computer_screenshot`. + * + */ + type: 'computer_screenshot'; + /** + * The URL of the screenshot image. + */ + image_url?: string; + /** + * The identifier of an uploaded file that contains the screenshot. + */ + file_id?: string; }; /** @@ -2338,31 +2415,31 @@ export type ComputerScreenshotImage = { * */ export type ComputerToolCall = { - /** - * The type of the computer call. Always `computer_call`. - */ - type: 'computer_call'; - /** - * The unique ID of the computer call. - */ - id: string; - /** - * An identifier used when responding to the tool call with output. - * - */ - call_id: string; - action: ComputerAction; - /** - * The pending safety checks for the computer call. - * - */ - pending_safety_checks: Array; - /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - */ - status: 'in_progress' | 'completed' | 'incomplete'; + /** + * The type of the computer call. Always `computer_call`. + */ + type: 'computer_call'; + /** + * The unique ID of the computer call. + */ + id: string; + /** + * An identifier used when responding to the tool call with output. + * + */ + call_id: string; + action: ComputerAction; + /** + * The pending safety checks for the computer call. + * + */ + pending_safety_checks: Array; + /** + * The status of the item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. + * + */ + status: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -2372,42 +2449,42 @@ export type ComputerToolCall = { * */ export type ComputerToolCallOutput = { - /** - * The type of the computer tool call output. Always `computer_call_output`. - * - */ - type: 'computer_call_output'; - /** - * The ID of the computer tool call output. - * - */ - id?: string; - /** - * The ID of the computer tool call that produced the output. - * - */ - call_id: string; - /** - * The safety checks reported by the API that have been acknowledged by the - * developer. - * - */ - acknowledged_safety_checks?: Array; - output: ComputerScreenshotImage; - /** - * The status of the message input. One of `in_progress`, `completed`, or - * `incomplete`. Populated when input items are returned via API. - * - */ - status?: 'in_progress' | 'completed' | 'incomplete'; + /** + * The type of the computer tool call output. Always `computer_call_output`. + * + */ + type: 'computer_call_output'; + /** + * The ID of the computer tool call output. + * + */ + id?: string; + /** + * The ID of the computer tool call that produced the output. + * + */ + call_id: string; + /** + * The safety checks reported by the API that have been acknowledged by the + * developer. + * + */ + acknowledged_safety_checks?: Array; + output: ComputerScreenshotImage; + /** + * The status of the message input. One of `in_progress`, `completed`, or + * `incomplete`. Populated when input items are returned via API. + * + */ + status?: 'in_progress' | 'completed' | 'incomplete'; }; export type ComputerToolCallOutputResource = ComputerToolCallOutput & { - /** - * The unique ID of the computer call tool output. - * - */ - id: string; + /** + * The unique ID of the computer call tool output. + * + */ + id: string; }; /** @@ -2415,140 +2492,140 @@ export type ComputerToolCallOutputResource = ComputerToolCallOutput & { * */ export type ComputerToolCallSafetyCheck = { - /** - * The ID of the pending safety check. - */ - id: string; - /** - * The type of the pending safety check. - */ - code: string; - /** - * Details about the pending safety check. - */ - message: string; + /** + * The ID of the pending safety check. + */ + id: string; + /** + * The type of the pending safety check. + */ + code: string; + /** + * Details about the pending safety check. + */ + message: string; }; export type ContainerFileListResource = { - /** - * The type of object returned, must be 'list'. - */ - object: 'list'; - /** - * A list of container files. - */ - data: Array; - /** - * The ID of the first file in the list. - */ - first_id: string; - /** - * The ID of the last file in the list. - */ - last_id: string; - /** - * Whether there are more files available. - */ - has_more: boolean; + /** + * The type of object returned, must be 'list'. + */ + object: 'list'; + /** + * A list of container files. + */ + data: Array; + /** + * The ID of the first file in the list. + */ + first_id: string; + /** + * The ID of the last file in the list. + */ + last_id: string; + /** + * Whether there are more files available. + */ + has_more: boolean; }; /** * The container file object */ export type ContainerFileResource = { - /** - * Unique identifier for the file. - */ - id: string; - /** - * The type of this object (`container.file`). - */ - object: 'container.file'; - /** - * The container this file belongs to. - */ - container_id: string; - /** - * Unix timestamp (in seconds) when the file was created. - */ - created_at: number; - /** - * Size of the file in bytes. - */ - bytes: number; - /** - * Path of the file in the container. - */ - path: string; - /** - * Source of the file (e.g., `user`, `assistant`). - */ - source: string; + /** + * Unique identifier for the file. + */ + id: string; + /** + * The type of this object (`container.file`). + */ + object: 'container.file'; + /** + * The container this file belongs to. + */ + container_id: string; + /** + * Unix timestamp (in seconds) when the file was created. + */ + created_at: number; + /** + * Size of the file in bytes. + */ + bytes: number; + /** + * Path of the file in the container. + */ + path: string; + /** + * Source of the file (e.g., `user`, `assistant`). + */ + source: string; }; export type ContainerListResource = { - /** - * The type of object returned, must be 'list'. - */ - object: 'list'; - /** - * A list of containers. - */ - data: Array; - /** - * The ID of the first container in the list. - */ - first_id: string; - /** - * The ID of the last container in the list. - */ - last_id: string; - /** - * Whether there are more containers available. - */ - has_more: boolean; + /** + * The type of object returned, must be 'list'. + */ + object: 'list'; + /** + * A list of containers. + */ + data: Array; + /** + * The ID of the first container in the list. + */ + first_id: string; + /** + * The ID of the last container in the list. + */ + last_id: string; + /** + * Whether there are more containers available. + */ + has_more: boolean; }; /** * The container object */ export type ContainerResource = { - /** - * Unique identifier for the container. - */ - id: string; - /** - * The type of this object. - */ - object: string; - /** - * Name of the container. - */ - name: string; - /** - * Unix timestamp (in seconds) when the container was created. - */ - created_at: number; - /** - * Status of the container (e.g., active, deleted). - */ - status: string; - /** - * The container will expire after this time period. - * The anchor is the reference point for the expiration. - * The minutes is the number of minutes after the anchor before the container expires. - * - */ - expires_after?: { - /** - * The reference point for the expiration. - */ - anchor?: 'last_active_at'; - /** - * The number of minutes after the anchor before the container expires. - */ - minutes?: number; - }; + /** + * Unique identifier for the container. + */ + id: string; + /** + * The type of this object. + */ + object: string; + /** + * Name of the container. + */ + name: string; + /** + * Unix timestamp (in seconds) when the container was created. + */ + created_at: number; + /** + * Status of the container (e.g., active, deleted). + */ + status: string; + /** + * The container will expire after this time period. + * The anchor is the reference point for the expiration. + * The minutes is the number of minutes after the anchor before the container expires. + * + */ + expires_after?: { + /** + * The reference point for the expiration. + */ + anchor?: 'last_active_at'; + /** + * The number of minutes after the anchor before the container expires. + */ + minutes?: number; + }; }; /** @@ -2564,216 +2641,833 @@ export type Content = InputContent | OutputContent; * */ export type Coordinate = { - /** - * The x-coordinate. - * - */ - x: number; - /** - * The y-coordinate. - * - */ - y: number; + /** + * The x-coordinate. + * + */ + x: number; + /** + * The y-coordinate. + * + */ + y: number; }; /** * The aggregated costs details of the specific time bucket. */ export type CostsResult = { - object: 'organization.costs.result'; - /** - * The monetary value in its associated currency. - */ - amount?: { - /** - * The numeric value of the cost. - */ - value?: number; - /** - * Lowercase ISO-4217 currency e.g. "usd" - */ - currency?: string; - }; + object: 'organization.costs.result'; + /** + * The monetary value in its associated currency. + */ + amount?: { /** - * When `group_by=line_item`, this field provides the line item of the grouped costs result. + * The numeric value of the cost. */ - line_item?: string; + value?: number; /** - * When `group_by=project_id`, this field provides the project ID of the grouped costs result. + * Lowercase ISO-4217 currency e.g. "usd" */ - project_id?: string; + currency?: string; + }; + /** + * When `group_by=line_item`, this field provides the line item of the grouped costs result. + */ + line_item?: string; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped costs result. + */ + project_id?: string; }; export type CreateAssistantRequest = { - /** - * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + /** + * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + * + */ + model: string | AssistantSupportedModels; + /** + * The name of the assistant. The maximum length is 256 characters. + * + */ + name?: string; + /** + * The description of the assistant. The maximum length is 512 characters. + * + */ + description?: string; + /** + * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * + */ + instructions?: string; + reasoning_effort?: ReasoningEffort; + /** + * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + * + */ + tools?: Array; + /** + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; + }; + file_search?: unknown & { + /** + * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + * + */ + vector_store_ids?: Array; + /** + * A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant. + * + */ + vector_stores?: Array<{ + /** + * 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. + * + */ + file_ids?: Array; + /** + * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + */ + chunking_strategy?: + | { + /** + * Always `auto`. + */ + type: 'auto'; + } + | { + /** + * Always `static`. + */ + type: 'static'; + static: { + /** + * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + */ + max_chunk_size_tokens: number; + /** + * The number of tokens that overlap between chunks. The default value is `400`. + * + * Note that the overlap must not exceed half of `max_chunk_size_tokens`. + * + */ + chunk_overlap_tokens: number; + }; + }; + metadata?: Metadata; + }>; + }; + }; + metadata?: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + response_format?: AssistantsApiResponseFormatOption; +}; + +export type CreateChatCompletionRequest = CreateModelResponseProperties & { + /** + * A list of messages comprising the conversation so far. Depending on the + * [model](https://platform.openai.com/docs/models) you use, different message types (modalities) are + * supported, like [text](https://platform.openai.com/docs/guides/text-generation), + * [images](https://platform.openai.com/docs/guides/vision), and [audio](https://platform.openai.com/docs/guides/audio). + * + */ + messages: Array; + /** + * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + * offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + * to browse and compare available models. + * + */ + model: ModelIdsShared; + modalities?: ResponseModalities; + verbosity?: Verbosity; + reasoning_effort?: ReasoningEffort; + /** + * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + * + */ + max_completion_tokens?: number; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on + * their existing frequency in the text so far, decreasing the model's + * likelihood to repeat the same line verbatim. + * + */ + frequency_penalty?: number; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on + * whether they appear in the text so far, increasing the model's likelihood + * to talk about new topics. + * + */ + presence_penalty?: number; + /** + * Web search + * + * This tool searches the web for relevant results to use in a response. + * Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). + * + */ + web_search_options?: { + /** + * Approximate location parameters for the search. + * + */ + user_location?: { + /** + * The type of location approximation. Always `approximate`. + * + */ + type: 'approximate'; + approximate: WebSearchLocation; + }; + search_context_size?: WebSearchContextSize; + }; + /** + * An integer between 0 and 20 specifying the number of most likely tokens to + * return at each token position, each with an associated log probability. + * `logprobs` must be set to `true` if this parameter is used. + * + */ + top_logprobs?: number; + /** + * An object specifying the format that the model must output. + * + * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables + * Structured Outputs which ensures the model will match your supplied JSON + * schema. Learn more in the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + * + * Setting to `{ "type": "json_object" }` enables the older JSON mode, which + * ensures the message the model generates is valid JSON. Using `json_schema` + * is preferred for models that support it. + * + */ + response_format?: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject; + /** + * Parameters for audio output. Required when audio output is requested with + * `modalities: ["audio"]`. [Learn more](https://platform.openai.com/docs/guides/audio). + * + */ + audio?: { + /** + * The voice the model uses to respond. Supported voices are + * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. * */ - model: string | AssistantSupportedModels; + voice: VoiceIdsShared; /** - * The name of the assistant. The maximum length is 256 characters. - * - */ - name?: string; + * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, + * `opus`, or `pcm16`. + * + */ + format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16'; + }; + /** + * Whether or not to store the output of this chat completion request for + * use in our [model distillation](https://platform.openai.com/docs/guides/distillation) or + * [evals](https://platform.openai.com/docs/guides/evals) products. + * + * Supports text and image inputs. Note: image inputs over 8MB will be dropped. + * + */ + store?: boolean; + /** + * If set to true, the model response data will be streamed to the client + * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + * See the [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming) + * for more information, along with the [streaming responses](https://platform.openai.com/docs/guides/streaming-responses) + * guide for more information on how to handle the streaming events. + * + */ + stream?: boolean; + stop?: StopConfiguration; + /** + * Modify the likelihood of specified tokens appearing in the completion. + * + * Accepts a JSON object that maps tokens (specified by their token ID in the + * tokenizer) to an associated bias value from -100 to 100. Mathematically, + * the bias is added to the logits generated by the model prior to sampling. + * The exact effect will vary per model, but values between -1 and 1 should + * decrease or increase likelihood of selection; values like -100 or 100 + * should result in a ban or exclusive selection of the relevant token. + * + */ + logit_bias?: { + [key: string]: number; + }; + /** + * Whether to return log probabilities of the output tokens or not. If true, + * returns the log probabilities of each output token returned in the + * `content` of `message`. + * + */ + logprobs?: boolean; + /** + * The maximum number of [tokens](/tokenizer) that can be generated in the + * chat completion. This value can be used to control + * [costs](https://openai.com/api/pricing/) for text generated via API. + * + * This value is now deprecated in favor of `max_completion_tokens`, and is + * not compatible with [o-series models](https://platform.openai.com/docs/guides/reasoning). + * + * + * @deprecated + */ + max_tokens?: number; + /** + * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + */ + n?: number; + /** + * Configuration for a [Predicted Output](https://platform.openai.com/docs/guides/predicted-outputs), + * which can greatly improve response times when large parts of the model + * response are known ahead of time. This is most common when you are + * regenerating a file with only minor changes to most of the content. + * + */ + prediction?: { + type?: 'PredictionContent'; + } & PredictionContent; + /** + * This feature is in Beta. + * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + * Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + * + * + * @deprecated + */ + seed?: number; + stream_options?: ChatCompletionStreamOptions; + /** + * A list of tools the model may call. You can provide either + * [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or + * [function tools](https://platform.openai.com/docs/guides/function-calling). + * + */ + tools?: Array< + | ({ + type?: 'ChatCompletionTool'; + } & ChatCompletionTool) + | ({ + type?: 'CustomToolChatCompletions'; + } & CustomToolChatCompletions) + >; + tool_choice?: ChatCompletionToolChoiceOption; + parallel_tool_calls?: ParallelToolCalls; + /** + * Deprecated in favor of `tool_choice`. + * + * Controls which (if any) function is called by the model. + * + * `none` means the model will not call a function and instead generates a + * message. + * + * `auto` means the model can pick between generating a message or calling a + * function. + * + * Specifying a particular function via `{"name": "my_function"}` forces the + * model to call that function. + * + * `none` is the default when no functions are present. `auto` is the default + * if functions are present. + * + * + * @deprecated + */ + function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption; + /** + * Deprecated in favor of `tools`. + * + * A list of functions the model may generate JSON inputs for. + * + * + * @deprecated + */ + functions?: Array; +}; + +/** + * Represents a chat completion response returned by model, based on the provided input. + */ +export type CreateChatCompletionResponse = { + /** + * A unique identifier for the chat completion. + */ + id: string; + /** + * A list of chat completion choices. Can be more than one if `n` is greater than 1. + */ + choices: Array<{ /** - * The description of the assistant. The maximum length is 512 characters. + * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + * `length` if the maximum number of tokens specified in the request was reached, + * `content_filter` if content was omitted due to a flag from our content filters, + * `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. * */ - description?: string; + finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call'; /** - * The system instructions that the assistant uses. The maximum length is 256,000 characters. - * + * The index of the choice in the list of choices. */ - instructions?: string; - reasoning_effort?: ReasoningEffort; - /** - * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - * - */ - tools?: Array; + index: number; + message: ChatCompletionResponseMessage; + /** + * Log probability information for the choice. + */ + logprobs: { + /** + * A list of message content tokens with log probability information. + */ + content: Array; + /** + * A list of message refusal tokens with log probability information. + */ + refusal: Array; + }; + }>; + /** + * The Unix timestamp (in seconds) of when the chat completion was created. + */ + created: number; + /** + * The model used for the chat completion. + */ + model: string; + service_tier?: ServiceTier; + /** + * This fingerprint represents the backend configuration that the model runs with. + * + * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + * + * + * @deprecated + */ + system_fingerprint?: string; + /** + * The object type, which is always `chat.completion`. + */ + object: 'chat.completion'; + usage?: CompletionUsage; +}; + +/** + * Represents a streamed chunk of a chat completion response returned + * by the model, based on the provided input. + * [Learn more](https://platform.openai.com/docs/guides/streaming-responses). + * + */ +export type CreateChatCompletionStreamResponse = { + /** + * A unique identifier for the chat completion. Each chunk has the same ID. + */ + id: string; + /** + * A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the + * last chunk if you set `stream_options: {"include_usage": true}`. + * + */ + choices: Array<{ + delta: ChatCompletionStreamResponseDelta; /** - * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * + * Log probability information for the choice. */ - tool_resources?: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: unknown & { - /** - * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - * - */ - vector_store_ids?: Array; - /** - * A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this assistant. There can be a maximum of 1 vector store attached to the assistant. - * - */ - vector_stores?: Array<{ - /** - * 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. - * - */ - file_ids?: Array; - /** - * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - */ - chunking_strategy?: { - /** - * Always `auto`. - */ - type: 'auto'; - } | { - /** - * Always `static`. - */ - type: 'static'; - static: { - /** - * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - */ - max_chunk_size_tokens: number; - /** - * The number of tokens that overlap between chunks. The default value is `400`. - * - * Note that the overlap must not exceed half of `max_chunk_size_tokens`. - * - */ - chunk_overlap_tokens: number; - }; - }; - metadata?: Metadata; - }>; - }; + logprobs?: { + /** + * A list of message content tokens with log probability information. + */ + content: Array; + /** + * A list of message refusal tokens with log probability information. + */ + refusal: Array; }; - metadata?: Metadata; /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + * `length` if the maximum number of tokens specified in the request was reached, + * `content_filter` if content was omitted due to a flag from our content filters, + * `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. * */ - temperature?: number; + finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call'; /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * + * The index of the choice in the list of choices. */ - top_p?: number; - response_format?: AssistantsApiResponseFormatOption; + index: number; + }>; + /** + * The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. + */ + created: number; + /** + * The model to generate the completion. + */ + model: string; + service_tier?: ServiceTier; + /** + * This fingerprint represents the backend configuration that the model runs with. + * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + * + * + * @deprecated + */ + system_fingerprint?: string; + /** + * The object type, which is always `chat.completion.chunk`. + */ + object: 'chat.completion.chunk'; + /** + * An optional field that will only be present when you set + * `stream_options: {"include_usage": true}` in your request. When present, it + * contains a null value **except for the last chunk** which contains the + * token usage statistics for the entire request. + * + * **NOTE:** If the stream is interrupted or cancelled, you may not + * receive the final usage chunk which contains the total token usage for + * the request. + * + */ + usage?: CompletionUsage; }; -export type CreateChatCompletionRequest = CreateModelResponseProperties & { +export type CreateCompletionRequest = { + /** + * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + * + */ + model: string | 'gpt-3.5-turbo-instruct' | 'davinci-002' | 'babbage-002'; + /** + * The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. + * + * Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. + * + */ + prompt: string | Array | Array | Array>; + /** + * Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. + * + * When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. + * + * **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + * + */ + best_of?: number; + /** + * Echo back the prompt in addition to the completion + * + */ + echo?: boolean; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. + * + * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) + * + */ + frequency_penalty?: number; + /** + * Modify the likelihood of specified tokens appearing in the completion. + * + * Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. + * + * As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + * + */ + logit_bias?: { + [key: string]: number; + }; + /** + * Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. + * + * The maximum value for `logprobs` is 5. + * + */ + logprobs?: number; + /** + * The maximum number of [tokens](/tokenizer) that can be generated in the completion. + * + * The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + * + */ + max_tokens?: number; + /** + * How many completions to generate for each prompt. + * + * **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. + * + */ + n?: number; + /** + * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. + * + * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) + * + */ + presence_penalty?: number; + /** + * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + * + * Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + * + */ + seed?: number; + stop?: StopConfiguration; + /** + * Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + * + */ + stream?: boolean; + stream_options?: ChatCompletionStreamOptions; + /** + * The suffix that comes after a completion of inserted text. + * + * This parameter is only supported for `gpt-3.5-turbo-instruct`. + * + */ + suffix?: string; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + * We generally recommend altering this or `top_p` but not both. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or `temperature` but not both. + * + */ + top_p?: number; + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * + */ + user?: string; +}; + +/** + * Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). + * + */ +export type CreateCompletionResponse = { + /** + * A unique identifier for the completion. + */ + id: string; + /** + * The list of completion choices the model generated for the input prompt. + */ + choices: Array<{ /** - * A list of messages comprising the conversation so far. Depending on the - * [model](https://platform.openai.com/docs/models) you use, different message types (modalities) are - * supported, like [text](https://platform.openai.com/docs/guides/text-generation), - * [images](https://platform.openai.com/docs/guides/vision), and [audio](https://platform.openai.com/docs/guides/audio). + * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, + * `length` if the maximum number of tokens specified in the request was reached, + * or `content_filter` if content was omitted due to a flag from our content filters. * */ - messages: Array; - /** - * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - * offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - * to browse and compare available models. - * + finish_reason: 'stop' | 'length' | 'content_filter'; + index: number; + logprobs: { + text_offset?: Array; + token_logprobs?: Array; + tokens?: Array; + top_logprobs?: Array<{ + [key: string]: number; + }>; + }; + text: string; + }>; + /** + * The Unix timestamp (in seconds) of when the completion was created. + */ + created: number; + /** + * The model used for completion. + */ + model: string; + /** + * This fingerprint represents the backend configuration that the model runs with. + * + * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. + * + */ + system_fingerprint?: string; + /** + * The object type, which is always "text_completion" + */ + object: 'text_completion'; + usage?: CompletionUsage; +}; + +export type CreateContainerBody = { + /** + * Name of the container to create. + */ + name: string; + /** + * IDs of files to copy to the container. + */ + file_ids?: Array; + /** + * Container expiration time in seconds relative to the 'anchor' time. + */ + expires_after?: { + /** + * Time anchor for the expiration time. Currently only 'last_active_at' is supported. */ - model: ModelIdsShared; - modalities?: ResponseModalities; - verbosity?: Verbosity; - reasoning_effort?: ReasoningEffort; + anchor: 'last_active_at'; + minutes: number; + }; +}; + +export type CreateContainerFileBody = { + /** + * Name of the file to create. + */ + file_id?: string; + /** + * The File object (not file name) to be uploaded. + * + */ + file?: Blob | File; +}; + +export type CreateEmbeddingRequest = { + /** + * Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request. + * + */ + input: string | Array | Array | Array>; + /** + * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + * + */ + model: string | 'text-embedding-ada-002' | 'text-embedding-3-small' | 'text-embedding-3-large'; + /** + * The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). + */ + encoding_format?: 'float' | 'base64'; + /** + * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + * + */ + dimensions?: number; + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * + */ + user?: string; +}; + +export type CreateEmbeddingResponse = { + /** + * The list of embeddings generated by the model. + */ + data: Array; + /** + * The name of the model used to generate the embedding. + */ + model: string; + /** + * The object type, which is always "list". + */ + object: 'list'; + /** + * The usage information for the request. + */ + usage: { + /** + * The number of tokens used by the prompt. + */ + prompt_tokens: number; /** - * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - * + * The total number of tokens used by the request. */ - max_completion_tokens?: number; + total_tokens: number; + }; +}; + +/** + * CompletionsRunDataSource + * + * A CompletionsRunDataSource object describing a model sampling configuration. + * + */ +export type CreateEvalCompletionsRunDataSource = { + /** + * The type of run data source. Always `completions`. + */ + type: 'completions'; + /** + * Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. + */ + input_messages?: + | { + /** + * The type of input messages. Always `template`. + */ + type: 'template'; + /** + * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + */ + template: Array< + | ({ + type?: 'EasyInputMessage'; + } & EasyInputMessage) + | ({ + type?: 'EvalItem'; + } & EvalItem) + >; + } + | { + /** + * The type of input messages. Always `item_reference`. + */ + type: 'item_reference'; + /** + * A reference to a variable in the `item` namespace. Ie, "item.input_trajectory" + */ + item_reference: string; + }; + sampling_params?: { /** - * Number between -2.0 and 2.0. Positive values penalize new tokens based on - * their existing frequency in the text so far, decreasing the model's - * likelihood to repeat the same line verbatim. - * + * A higher temperature increases randomness in the outputs. */ - frequency_penalty?: number; + temperature?: number; /** - * Number between -2.0 and 2.0. Positive values penalize new tokens based on - * whether they appear in the text so far, increasing the model's likelihood - * to talk about new topics. - * + * The maximum number of tokens in the generated output. */ - presence_penalty?: number; + max_completion_tokens?: number; /** - * Web search - * - * This tool searches the web for relevant results to use in a response. - * Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search?api-mode=chat). - * + * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ - web_search_options?: { - /** - * Approximate location parameters for the search. - * - */ - user_location?: { - /** - * The type of location approximation. Always `approximate`. - * - */ - type: 'approximate'; - approximate: WebSearchLocation; - }; - search_context_size?: WebSearchContextSize; - }; + top_p?: number; /** - * An integer between 0 and 20 specifying the number of most likely tokens to - * return at each token position, each with an associated log probability. - * `logprobs` must be set to `true` if this parameter is used. - * + * A seed value to initialize the randomness, during sampling. */ - top_logprobs?: number; + seed?: number; /** * An object specifying the format that the model must output. * @@ -2789,3587 +3483,3123 @@ export type CreateChatCompletionRequest = CreateModelResponseProperties & { */ response_format?: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject; /** - * Parameters for audio output. Required when audio output is requested with - * `modalities: ["audio"]`. [Learn more](https://platform.openai.com/docs/guides/audio). + * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. * */ - audio?: { + tools?: Array; + }; + /** + * The name of the model to use for generating completions (e.g. "o3-mini"). + */ + model?: string; + /** + * Determines what populates the `item` namespace in this run's data source. + */ + source: + | ({ + type?: 'EvalJsonlFileContentSource'; + } & EvalJsonlFileContentSource) + | ({ + type?: 'EvalJsonlFileIdSource'; + } & EvalJsonlFileIdSource) + | ({ + type?: 'EvalStoredCompletionsSource'; + } & EvalStoredCompletionsSource); +}; + +/** + * CustomDataSourceConfig + * + * A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs. + * This schema is used to define the shape of the data that will be: + * - Used to define your testing criteria and + * - What data is required when creating a run + * + */ +export type CreateEvalCustomDataSourceConfig = { + /** + * The type of data source. Always `custom`. + */ + type: 'custom'; + /** + * The json schema for each row in the data source. + */ + item_schema: { + [key: string]: unknown; + }; + /** + * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) + */ + include_sample_schema?: boolean; +}; + +/** + * CreateEvalItem + * + * A chat message that makes up the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + */ +export type CreateEvalItem = + | { + /** + * The role of the message (e.g. "system", "assistant", "user"). + */ + role: string; + /** + * The content of the message. + */ + content: string; + } + | EvalItem; + +/** + * JsonlRunDataSource + * + * A JsonlRunDataSource object with that specifies a JSONL file that matches the eval + * + */ +export type CreateEvalJsonlRunDataSource = { + /** + * The type of data source. Always `jsonl`. + */ + type: 'jsonl'; + /** + * Determines what populates the `item` namespace in the data source. + */ + source: + | ({ + type?: 'EvalJsonlFileContentSource'; + } & EvalJsonlFileContentSource) + | ({ + type?: 'EvalJsonlFileIdSource'; + } & EvalJsonlFileIdSource); +}; + +/** + * LabelModelGrader + * + * A LabelModelGrader object which uses a model to assign labels to each item + * in the evaluation. + * + */ +export type CreateEvalLabelModelGrader = { + /** + * The object type, which is always `label_model`. + */ + type: 'label_model'; + /** + * The name of the grader. + */ + name: string; + /** + * The model to use for the evaluation. Must support structured outputs. + */ + model: string; + /** + * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + */ + input: Array; + /** + * The labels to classify to each item in the evaluation. + */ + labels: Array; + /** + * The labels that indicate a passing result. Must be a subset of labels. + */ + passing_labels: Array; +}; + +/** + * LogsDataSourceConfig + * + * A data source config which specifies the metadata property of your logs query. + * This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. + * + */ +export type CreateEvalLogsDataSourceConfig = { + /** + * The type of data source. Always `logs`. + */ + type: 'logs'; + /** + * Metadata filters for the logs data source. + */ + metadata?: { + [key: string]: unknown; + }; +}; + +/** + * CreateEvalRequest + */ +export type CreateEvalRequest = { + /** + * The name of the evaluation. + */ + name?: string; + metadata?: Metadata; + /** + * The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation. + */ + data_source_config: + | ({ + type?: 'CreateEvalCustomDataSourceConfig'; + } & CreateEvalCustomDataSourceConfig) + | ({ + type?: 'CreateEvalLogsDataSourceConfig'; + } & CreateEvalLogsDataSourceConfig) + | ({ + type?: 'CreateEvalStoredCompletionsDataSourceConfig'; + } & CreateEvalStoredCompletionsDataSourceConfig); + /** + * A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`). + */ + testing_criteria: Array< + | ({ + type?: 'CreateEvalLabelModelGrader'; + } & CreateEvalLabelModelGrader) + | ({ + type?: 'EvalGraderStringCheck'; + } & EvalGraderStringCheck) + | ({ + type?: 'EvalGraderTextSimilarity'; + } & EvalGraderTextSimilarity) + | ({ + type?: 'EvalGraderPython'; + } & EvalGraderPython) + | ({ + type?: 'EvalGraderScoreModel'; + } & EvalGraderScoreModel) + >; +}; + +/** + * ResponsesRunDataSource + * + * A ResponsesRunDataSource object describing a model sampling configuration. + * + */ +export type CreateEvalResponsesRunDataSource = { + /** + * The type of run data source. Always `responses`. + */ + type: 'responses'; + /** + * Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. + */ + input_messages?: + | { /** - * The voice the model uses to respond. Supported voices are - * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. - * + * The type of input messages. Always `template`. */ - voice: VoiceIdsShared; + type: 'template'; /** - * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, - * `opus`, or `pcm16`. - * + * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. */ - format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16'; - }; - /** - * Whether or not to store the output of this chat completion request for - * use in our [model distillation](https://platform.openai.com/docs/guides/distillation) or - * [evals](https://platform.openai.com/docs/guides/evals) products. - * - * Supports text and image inputs. Note: image inputs over 8MB will be dropped. - * - */ - store?: boolean; - /** - * If set to true, the model response data will be streamed to the client - * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - * See the [Streaming section below](https://platform.openai.com/docs/api-reference/chat/streaming) - * for more information, along with the [streaming responses](https://platform.openai.com/docs/guides/streaming-responses) - * guide for more information on how to handle the streaming events. - * - */ - stream?: boolean; - stop?: StopConfiguration; - /** - * Modify the likelihood of specified tokens appearing in the completion. - * - * Accepts a JSON object that maps tokens (specified by their token ID in the - * tokenizer) to an associated bias value from -100 to 100. Mathematically, - * the bias is added to the logits generated by the model prior to sampling. - * The exact effect will vary per model, but values between -1 and 1 should - * decrease or increase likelihood of selection; values like -100 or 100 - * should result in a ban or exclusive selection of the relevant token. - * - */ - logit_bias?: { - [key: string]: number; - }; - /** - * Whether to return log probabilities of the output tokens or not. If true, - * returns the log probabilities of each output token returned in the - * `content` of `message`. - * - */ - logprobs?: boolean; + template: Array< + | { + /** + * The role of the message (e.g. "system", "assistant", "user"). + */ + role: string; + /** + * The content of the message. + */ + content: string; + } + | EvalItem + >; + } + | { + /** + * The type of input messages. Always `item_reference`. + */ + type: 'item_reference'; + /** + * A reference to a variable in the `item` namespace. Ie, "item.name" + */ + item_reference: string; + }; + sampling_params?: { /** - * The maximum number of [tokens](/tokenizer) that can be generated in the - * chat completion. This value can be used to control - * [costs](https://openai.com/api/pricing/) for text generated via API. - * - * This value is now deprecated in favor of `max_completion_tokens`, and is - * not compatible with [o-series models](https://platform.openai.com/docs/guides/reasoning). - * - * - * @deprecated + * A higher temperature increases randomness in the outputs. */ - max_tokens?: number; + temperature?: number; /** - * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep `n` as `1` to minimize costs. + * The maximum number of tokens in the generated output. */ - n?: number; + max_completion_tokens?: number; /** - * Configuration for a [Predicted Output](https://platform.openai.com/docs/guides/predicted-outputs), - * which can greatly improve response times when large parts of the model - * response are known ahead of time. This is most common when you are - * regenerating a file with only minor changes to most of the content. - * + * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ - prediction?: { - type?: 'PredictionContent'; - } & PredictionContent; + top_p?: number; /** - * This feature is in Beta. - * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. - * Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. - * - * - * @deprecated + * A seed value to initialize the randomness, during sampling. */ seed?: number; - stream_options?: ChatCompletionStreamOptions; - /** - * A list of tools the model may call. You can provide either - * [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools) or - * [function tools](https://platform.openai.com/docs/guides/function-calling). - * - */ - tools?: Array<({ - type?: 'ChatCompletionTool'; - } & ChatCompletionTool) | ({ - type?: 'CustomToolChatCompletions'; - } & CustomToolChatCompletions)>; - tool_choice?: ChatCompletionToolChoiceOption; - parallel_tool_calls?: ParallelToolCalls; /** - * Deprecated in favor of `tool_choice`. - * - * Controls which (if any) function is called by the model. - * - * `none` means the model will not call a function and instead generates a - * message. - * - * `auto` means the model can pick between generating a message or calling a - * function. - * - * Specifying a particular function via `{"name": "my_function"}` forces the - * model to call that function. + * An array of tools the model may call while generating a response. You + * can specify which tool to use by setting the `tool_choice` parameter. * - * `none` is the default when no functions are present. `auto` is the default - * if functions are present. + * The two categories of tools you can provide the model are: * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the + * model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + * or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, + * enabling the model to call your own code. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). * - * @deprecated */ - function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption; + tools?: Array; /** - * Deprecated in favor of `tools`. - * - * A list of functions the model may generate JSON inputs for. - * + * Configuration options for a text response from the model. Can be plain + * text or structured JSON data. Learn more: + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) * - * @deprecated */ - functions?: Array; + text?: { + format?: TextResponseFormatConfiguration; + }; + }; + /** + * The name of the model to use for generating completions (e.g. "o3-mini"). + */ + model?: string; + /** + * Determines what populates the `item` namespace in this run's data source. + */ + source: + | ({ + type?: 'EvalJsonlFileContentSource'; + } & EvalJsonlFileContentSource) + | ({ + type?: 'EvalJsonlFileIdSource'; + } & EvalJsonlFileIdSource) + | ({ + type?: 'EvalResponsesSource'; + } & EvalResponsesSource); }; /** - * Represents a chat completion response returned by model, based on the provided input. + * CreateEvalRunRequest */ -export type CreateChatCompletionResponse = { - /** - * A unique identifier for the chat completion. - */ - id: string; - /** - * A list of chat completion choices. Can be more than one if `n` is greater than 1. - */ - choices: Array<{ - /** - * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, - * `length` if the maximum number of tokens specified in the request was reached, - * `content_filter` if content was omitted due to a flag from our content filters, - * `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. - * - */ - finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call'; - /** - * The index of the choice in the list of choices. - */ - index: number; - message: ChatCompletionResponseMessage; - /** - * Log probability information for the choice. - */ - logprobs: { - /** - * A list of message content tokens with log probability information. - */ - content: Array; - /** - * A list of message refusal tokens with log probability information. - */ - refusal: Array; - }; - }>; - /** - * The Unix timestamp (in seconds) of when the chat completion was created. - */ - created: number; - /** - * The model used for the chat completion. - */ - model: string; - service_tier?: ServiceTier; - /** - * This fingerprint represents the backend configuration that the model runs with. - * - * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. - * - * - * @deprecated - */ - system_fingerprint?: string; - /** - * The object type, which is always `chat.completion`. - */ - object: 'chat.completion'; - usage?: CompletionUsage; +export type CreateEvalRunRequest = { + /** + * The name of the run. + */ + name?: string; + metadata?: Metadata; + /** + * Details about the run's data source. + */ + data_source: + | CreateEvalJsonlRunDataSource + | CreateEvalCompletionsRunDataSource + | CreateEvalResponsesRunDataSource; }; /** - * Represents a streamed chunk of a chat completion response returned - * by the model, based on the provided input. - * [Learn more](https://platform.openai.com/docs/guides/streaming-responses). + * StoredCompletionsDataSourceConfig + * + * Deprecated in favor of LogsDataSourceConfig. + * * + * @deprecated */ -export type CreateChatCompletionStreamResponse = { - /** - * A unique identifier for the chat completion. Each chunk has the same ID. - */ - id: string; - /** - * A list of chat completion choices. Can contain more than one elements if `n` is greater than 1. Can also be empty for the - * last chunk if you set `stream_options: {"include_usage": true}`. - * - */ - choices: Array<{ - delta: ChatCompletionStreamResponseDelta; - /** - * Log probability information for the choice. - */ - logprobs?: { - /** - * A list of message content tokens with log probability information. - */ - content: Array; - /** - * A list of message refusal tokens with log probability information. - */ - refusal: Array; - }; - /** - * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, - * `length` if the maximum number of tokens specified in the request was reached, - * `content_filter` if content was omitted due to a flag from our content filters, - * `tool_calls` if the model called a tool, or `function_call` (deprecated) if the model called a function. - * - */ - finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call'; - /** - * The index of the choice in the list of choices. - */ - index: number; - }>; - /** - * The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. - */ - created: number; - /** - * The model to generate the completion. - */ - model: string; - service_tier?: ServiceTier; - /** - * This fingerprint represents the backend configuration that the model runs with. - * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. - * - * - * @deprecated - */ - system_fingerprint?: string; - /** - * The object type, which is always `chat.completion.chunk`. - */ - object: 'chat.completion.chunk'; - /** - * An optional field that will only be present when you set - * `stream_options: {"include_usage": true}` in your request. When present, it - * contains a null value **except for the last chunk** which contains the - * token usage statistics for the entire request. - * - * **NOTE:** If the stream is interrupted or cancelled, you may not - * receive the final usage chunk which contains the total token usage for - * the request. - * - */ - usage?: CompletionUsage; +export type CreateEvalStoredCompletionsDataSourceConfig = { + /** + * The type of data source. Always `stored_completions`. + */ + type: 'stored_completions'; + /** + * Metadata filters for the stored completions data source. + */ + metadata?: { + [key: string]: unknown; + }; }; -export type CreateCompletionRequest = { - /** - * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - * - */ - model: string | 'gpt-3.5-turbo-instruct' | 'davinci-002' | 'babbage-002'; - /** - * The prompt(s) to generate completions for, encoded as a string, array of strings, array of tokens, or array of token arrays. - * - * Note that <|endoftext|> is the document separator that the model sees during training, so if a prompt is not specified the model will generate as if from the beginning of a new document. - * - */ - prompt: string | Array | Array | Array>; - /** - * Generates `best_of` completions server-side and returns the "best" (the one with the highest log probability per token). Results cannot be streamed. - * - * When used with `n`, `best_of` controls the number of candidate completions and `n` specifies how many to return – `best_of` must be greater than `n`. - * - * **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. - * - */ - best_of?: number; - /** - * Echo back the prompt in addition to the completion +export type CreateFileRequest = { + /** + * The File object (not file name) to be uploaded. + * + */ + file: Blob | File; + purpose: FilePurpose; + expires_after?: FileExpirationAfter; +}; + +export type CreateFineTuningCheckpointPermissionRequest = { + /** + * The project identifiers to grant access to. + */ + project_ids: Array; +}; + +export type CreateFineTuningJobRequest = { + /** + * The name of the model to fine-tune. You can select one of the + * [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). + * + */ + model: string | 'babbage-002' | 'davinci-002' | 'gpt-3.5-turbo' | 'gpt-4o-mini'; + /** + * The ID of an uploaded file that contains training data. + * + * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. + * + * Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. + * + * The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format. + * + * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. + * + */ + training_file: string; + /** + * The hyperparameters used for the fine-tuning job. + * This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter. + * + * + * @deprecated + */ + hyperparameters?: { + /** + * Number of examples in each batch. A larger batch size means that model parameters + * are updated less frequently, but with lower variance. * */ - echo?: boolean; + batch_size?: 'auto' | number; /** - * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. - * - * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid + * overfitting. * */ - frequency_penalty?: number; + learning_rate_multiplier?: 'auto' | number; /** - * Modify the likelihood of specified tokens appearing in the completion. - * - * Accepts a JSON object that maps tokens (specified by their token ID in the GPT tokenizer) to an associated bias value from -100 to 100. You can use this [tokenizer tool](/tokenizer?view=bpe) to convert text to token IDs. Mathematically, the bias is added to the logits generated by the model prior to sampling. The exact effect will vary per model, but values between -1 and 1 should decrease or increase likelihood of selection; values like -100 or 100 should result in a ban or exclusive selection of the relevant token. - * - * As an example, you can pass `{"50256": -100}` to prevent the <|endoftext|> token from being generated. + * The number of epochs to train the model for. An epoch refers to one full cycle + * through the training dataset. * */ - logit_bias?: { - [key: string]: number; - }; - /** - * Include the log probabilities on the `logprobs` most likely output tokens, as well the chosen tokens. For example, if `logprobs` is 5, the API will return a list of the 5 most likely tokens. The API will always return the `logprob` of the sampled token, so there may be up to `logprobs+1` elements in the response. - * - * The maximum value for `logprobs` is 5. + n_epochs?: 'auto' | number; + }; + /** + * A string of up to 64 characters that will be added to your fine-tuned model name. + * + * For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. + * + */ + suffix?: string; + /** + * The ID of an uploaded file that contains validation data. + * + * If you provide this file, the data is used to generate validation + * metrics periodically during fine-tuning. These metrics can be viewed in + * the fine-tuning results file. + * The same data should not be present in both train and validation files. + * + * Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. + * + * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. + * + */ + validation_file?: string; + /** + * A list of integrations to enable for your fine-tuning job. + */ + integrations?: Array<{ + /** + * The type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported. * */ - logprobs?: number; + type: 'wandb'; /** - * The maximum number of [tokens](/tokenizer) that can be generated in the completion. - * - * The token count of your prompt plus `max_tokens` cannot exceed the model's context length. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. + * The settings for your integration with Weights and Biases. This payload specifies the project that + * metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags + * to your run, and set a default entity (team, username, etc) to be associated with your run. * */ - max_tokens?: number; - /** - * How many completions to generate for each prompt. - * - * **Note:** Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for `max_tokens` and `stop`. - * + wandb: { + /** + * The name of the project that the new run will be created under. + * + */ + project: string; + /** + * A display name to set for the run. If not set, we will use the Job ID as the name. + * + */ + name?: string; + /** + * The entity to use for the run. This allows you to set the team or username of the WandB user that you would + * like associated with the run. If not set, the default entity for the registered WandB API key is used. + * + */ + entity?: string; + /** + * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some + * default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". + * + */ + tags?: Array; + }; + }>; + /** + * The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. + * If a seed is not specified, one will be generated for you. + * + */ + seed?: number; + method?: FineTuneMethod; + metadata?: Metadata; +}; + +export type CreateImageEditRequest = { + /** + * The image(s) to edit. Must be a supported image file or an array of images. + * + * For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less + * than 50MB. You can provide up to 16 images. + * + * For `dall-e-2`, you can only provide one image, and it should be a square + * `png` file less than 4MB. + * + */ + image: Blob | File | Array; + /** + * A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + */ + prompt: string; + /** + * An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. + */ + mask?: Blob | File; + /** + * Allows to set transparency for the background of the generated image(s). + * This parameter is only supported for `gpt-image-1`. Must be one of + * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + * model will automatically determine the best background for the image. + * + * If `transparent`, the output format needs to support transparency, so it + * should be set to either `png` (default value) or `webp`. + * + */ + background?: 'transparent' | 'opaque' | 'auto'; + /** + * The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used. + */ + model?: string | 'dall-e-2' | 'gpt-image-1'; + /** + * The number of images to generate. Must be between 1 and 10. + */ + n?: number; + /** + * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + */ + size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto'; + /** + * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` will always return base64-encoded images. + */ + response_format?: 'url' | 'b64_json'; + /** + * The format in which the generated images are returned. This parameter is + * only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + * The default value is `png`. + * + */ + output_format?: 'png' | 'jpeg' | 'webp'; + /** + * The compression level (0-100%) for the generated images. This parameter + * is only supported for `gpt-image-1` with the `webp` or `jpeg` output + * formats, and defaults to 100. + * + */ + output_compression?: number; + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * + */ + user?: string; + input_fidelity?: ImageInputFidelity; + /** + * Edit the image in streaming mode. Defaults to `false`. See the + * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. + * + */ + stream?: boolean; + partial_images?: PartialImages; + /** + * The quality of the image that will be generated. `high`, `medium` and `low` are only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. Defaults to `auto`. + * + */ + quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto'; +}; + +export type CreateImageRequest = { + /** + * A text description of the desired image(s). The maximum length is 32000 characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + */ + prompt: string; + /** + * The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used. + */ + model?: string | 'dall-e-2' | 'dall-e-3' | 'gpt-image-1'; + /** + * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. + */ + n?: number; + /** + * The quality of the image that will be generated. + * + * - `auto` (default value) will automatically select the best quality for the given model. + * - `high`, `medium` and `low` are supported for `gpt-image-1`. + * - `hd` and `standard` are supported for `dall-e-3`. + * - `standard` is the only option for `dall-e-2`. + * + */ + quality?: 'standard' | 'hd' | 'low' | 'medium' | 'high' | 'auto'; + /** + * The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for `gpt-image-1` which will always return base64-encoded images. + */ + response_format?: 'url' | 'b64_json'; + /** + * The format in which the generated images are returned. This parameter is only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + */ + output_format?: 'png' | 'jpeg' | 'webp'; + /** + * The compression level (0-100%) for the generated images. This parameter is only supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and defaults to 100. + */ + output_compression?: number; + /** + * Generate the image in streaming mode. Defaults to `false`. See the + * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. + * This parameter is only supported for `gpt-image-1`. + * + */ + stream?: boolean; + partial_images?: PartialImages; + /** + * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. + */ + size?: + | 'auto' + | '1024x1024' + | '1536x1024' + | '1024x1536' + | '256x256' + | '512x512' + | '1792x1024' + | '1024x1792'; + /** + * Control the content-moderation level for images generated by `gpt-image-1`. Must be either `low` for less restrictive filtering or `auto` (default value). + */ + moderation?: 'low' | 'auto'; + /** + * Allows to set transparency for the background of the generated image(s). + * This parameter is only supported for `gpt-image-1`. Must be one of + * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the + * model will automatically determine the best background for the image. + * + * If `transparent`, the output format needs to support transparency, so it + * should be set to either `png` (default value) or `webp`. + * + */ + background?: 'transparent' | 'opaque' | 'auto'; + /** + * The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. + */ + style?: 'vivid' | 'natural'; + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * + */ + user?: string; +}; + +export type CreateImageVariationRequest = { + /** + * The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. + */ + image: Blob | File; + /** + * The model to use for image generation. Only `dall-e-2` is supported at this time. + */ + model?: string | 'dall-e-2'; + /** + * The number of images to generate. Must be between 1 and 10. + */ + n?: number; + /** + * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. + */ + response_format?: 'url' | 'b64_json'; + /** + * The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. + */ + size?: '256x256' | '512x512' | '1024x1024'; + /** + * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * + */ + user?: string; +}; + +export type CreateMessageRequest = { + /** + * The role of the entity that is creating the message. Allowed values include: + * - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. + * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. + * + */ + role: 'user' | 'assistant'; + content: + | string + | Array< + | ({ + type?: 'MessageContentImageFileObject'; + } & MessageContentImageFileObject) + | ({ + type?: 'MessageContentImageUrlObject'; + } & MessageContentImageUrlObject) + | ({ + type?: 'MessageRequestContentTextObject'; + } & MessageRequestContentTextObject) + >; + /** + * A list of files attached to the message, and the tools they should be added to. + */ + attachments?: Array<{ + /** + * The ID of the file to attach to the message. */ - n?: number; + file_id?: string; /** - * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. - * - * [See more information about frequency and presence penalties.](https://platform.openai.com/docs/guides/text-generation) - * + * The tools to add this file to. */ - presence_penalty?: number; + tools?: Array< + | ({ + type?: 'AssistantToolsCode'; + } & AssistantToolsCode) + | ({ + type?: 'AssistantToolsFileSearchTypeOnly'; + } & AssistantToolsFileSearchTypeOnly) + >; + }>; + metadata?: Metadata; +}; + +export type CreateModelResponseProperties = ModelResponseProperties & { + /** + * An integer between 0 and 20 specifying the number of most likely tokens to + * return at each token position, each with an associated log probability. + * + */ + top_logprobs?: number; +}; + +export type CreateModerationRequest = { + /** + * Input (or inputs) to classify. Can be a single string, an array of strings, or + * an array of multi-modal input objects similar to other models. + * + */ + input: + | string + | Array + | Array< + | ({ + type?: 'ModerationImageURLInput'; + } & ModerationImageUrlInput) + | ({ + type?: 'ModerationTextInput'; + } & ModerationTextInput) + >; + /** + * The content moderation model you would like to use. Learn more in + * [the moderation guide](https://platform.openai.com/docs/guides/moderation), and learn about + * available models [here](https://platform.openai.com/docs/models#moderation). + * + */ + model?: + | string + | 'omni-moderation-latest' + | 'omni-moderation-2024-09-26' + | 'text-moderation-latest' + | 'text-moderation-stable'; +}; + +/** + * Represents if a given text input is potentially harmful. + */ +export type CreateModerationResponse = { + /** + * The unique identifier for the moderation request. + */ + id: string; + /** + * The model used to generate the moderation results. + */ + model: string; + /** + * A list of moderation objects. + */ + results: Array<{ + /** + * Whether any of the below categories are flagged. + */ + flagged: boolean; + /** + * A list of the categories, and whether they are flagged or not. + */ + categories: { + /** + * Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment. + */ + hate: boolean; + /** + * Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. + */ + 'hate/threatening': boolean; + /** + * Content that expresses, incites, or promotes harassing language towards any target. + */ + harassment: boolean; + /** + * Harassment content that also includes violence or serious harm towards any target. + */ + 'harassment/threatening': boolean; + /** + * Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, "how to shoplift" would fit this category. + */ + illicit: boolean; + /** + * Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon. + */ + 'illicit/violent': boolean; + /** + * Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. + */ + 'self-harm': boolean; + /** + * Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. + */ + 'self-harm/intent': boolean; + /** + * Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. + */ + 'self-harm/instructions': boolean; + /** + * Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). + */ + sexual: boolean; + /** + * Sexual content that includes an individual who is under 18 years old. + */ + 'sexual/minors': boolean; + /** + * Content that depicts death, violence, or physical injury. + */ + violence: boolean; + /** + * Content that depicts death, violence, or physical injury in graphic detail. + */ + 'violence/graphic': boolean; + }; + /** + * A list of the categories along with their scores as predicted by model. + */ + category_scores: { + /** + * The score for the category 'hate'. + */ + hate: number; + /** + * The score for the category 'hate/threatening'. + */ + 'hate/threatening': number; + /** + * The score for the category 'harassment'. + */ + harassment: number; + /** + * The score for the category 'harassment/threatening'. + */ + 'harassment/threatening': number; + /** + * The score for the category 'illicit'. + */ + illicit: number; + /** + * The score for the category 'illicit/violent'. + */ + 'illicit/violent': number; + /** + * The score for the category 'self-harm'. + */ + 'self-harm': number; + /** + * The score for the category 'self-harm/intent'. + */ + 'self-harm/intent': number; + /** + * The score for the category 'self-harm/instructions'. + */ + 'self-harm/instructions': number; + /** + * The score for the category 'sexual'. + */ + sexual: number; + /** + * The score for the category 'sexual/minors'. + */ + 'sexual/minors': number; + /** + * The score for the category 'violence'. + */ + violence: number; + /** + * The score for the category 'violence/graphic'. + */ + 'violence/graphic': number; + }; + /** + * A list of the categories along with the input type(s) that the score applies to. + */ + category_applied_input_types: { + /** + * The applied input type(s) for the category 'hate'. + */ + hate: Array<'text'>; + /** + * The applied input type(s) for the category 'hate/threatening'. + */ + 'hate/threatening': Array<'text'>; + /** + * The applied input type(s) for the category 'harassment'. + */ + harassment: Array<'text'>; + /** + * The applied input type(s) for the category 'harassment/threatening'. + */ + 'harassment/threatening': Array<'text'>; + /** + * The applied input type(s) for the category 'illicit'. + */ + illicit: Array<'text'>; + /** + * The applied input type(s) for the category 'illicit/violent'. + */ + 'illicit/violent': Array<'text'>; + /** + * The applied input type(s) for the category 'self-harm'. + */ + 'self-harm': Array<'text' | 'image'>; + /** + * The applied input type(s) for the category 'self-harm/intent'. + */ + 'self-harm/intent': Array<'text' | 'image'>; + /** + * The applied input type(s) for the category 'self-harm/instructions'. + */ + 'self-harm/instructions': Array<'text' | 'image'>; + /** + * The applied input type(s) for the category 'sexual'. + */ + sexual: Array<'text' | 'image'>; + /** + * The applied input type(s) for the category 'sexual/minors'. + */ + 'sexual/minors': Array<'text'>; + /** + * The applied input type(s) for the category 'violence'. + */ + violence: Array<'text' | 'image'>; + /** + * The applied input type(s) for the category 'violence/graphic'. + */ + 'violence/graphic': Array<'text' | 'image'>; + }; + }>; +}; + +export type CreateResponse = CreateModelResponseProperties & + ResponseProperties & { /** - * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same `seed` and parameters should return the same result. + * Text, image, or file inputs to the model, used to generate a response. * - * Determinism is not guaranteed, and you should refer to the `system_fingerprint` response parameter to monitor changes in the backend. + * Learn more: + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Image inputs](https://platform.openai.com/docs/guides/images) + * - [File inputs](https://platform.openai.com/docs/guides/pdf-files) + * - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) + * - [Function calling](https://platform.openai.com/docs/guides/function-calling) * */ - seed?: number; - stop?: StopConfiguration; + input?: string | Array; /** - * Whether to stream back partial progress. If set, tokens will be sent as data-only [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format) as they become available, with the stream terminated by a `data: [DONE]` message. [Example Python code](https://cookbook.openai.com/examples/how_to_stream_completions). + * Specify additional output data to include in the model response. Currently + * supported values are: + * - `code_interpreter_call.outputs`: Includes the outputs of python code execution + * in code interpreter tool call items. + * - `computer_call_output.output.image_url`: Include image urls from the computer call output. + * - `file_search_call.results`: Include the search results of + * the file search tool call. + * - `message.input_image.image_url`: Include image urls from the input message. + * - `message.output_text.logprobs`: Include logprobs with assistant messages. + * - `reasoning.encrypted_content`: Includes an encrypted version of reasoning + * tokens in reasoning item outputs. This enables reasoning items to be used in + * multi-turn conversations when using the Responses API statelessly (like + * when the `store` parameter is set to `false`, or when an organization is + * enrolled in the zero data retention program). * */ - stream?: boolean; - stream_options?: ChatCompletionStreamOptions; + include?: Array; /** - * The suffix that comes after a completion of inserted text. - * - * This parameter is only supported for `gpt-3.5-turbo-instruct`. + * Whether to allow the model to run tool calls in parallel. * */ - suffix?: string; + parallel_tool_calls?: boolean; /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - * We generally recommend altering this or `top_p` but not both. + * Whether to store the generated model response for later retrieval via + * API. * */ - temperature?: number; + store?: boolean; /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * A system (or developer) message inserted into the model's context. * - * We generally recommend altering this or `temperature` but not both. + * When using along with `previous_response_id`, the instructions from a previous + * response will not be carried over to the next response. This makes it simple + * to swap out system (or developer) messages in new responses. * */ - top_p?: number; + instructions?: string; /** - * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * If set to true, the model response data will be streamed to the client + * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + * for more information. * */ - user?: string; + stream?: boolean; + stream_options?: ResponseStreamOptions; + }; + +export type CreateRunRequest = { + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + */ + assistant_id: string; + /** + * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + */ + model?: string | AssistantSupportedModels; + reasoning_effort?: ReasoningEffort; + /** + * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. + */ + instructions?: string; + /** + * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. + */ + additional_instructions?: string; + /** + * Adds additional messages to the thread before creating the run. + */ + additional_messages?: Array; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + metadata?: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + /** + * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. + * + */ + stream?: boolean; + /** + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_prompt_tokens?: number; + /** + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_completion_tokens?: number; + truncation_strategy?: TruncationObject & unknown; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + parallel_tool_calls?: ParallelToolCalls; + response_format?: AssistantsApiResponseFormatOption; +}; + +export type CreateSpeechRequest = { + /** + * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. + * + */ + model: string | 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts'; + /** + * The text to generate audio for. The maximum length is 4096 characters. + */ + input: string; + /** + * Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. + */ + instructions?: string; + /** + * 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 [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). + */ + voice: VoiceIdsShared; + /** + * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. + */ + response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'; + /** + * The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. + */ + speed?: number; + /** + * The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`. + */ + stream_format?: 'sse' | 'audio'; +}; + +export type CreateSpeechResponseStreamEvent = + | ({ + type?: 'SpeechAudioDeltaEvent'; + } & SpeechAudioDeltaEvent) + | ({ + type?: 'SpeechAudioDoneEvent'; + } & SpeechAudioDoneEvent); + +export type CreateThreadAndRunRequest = { + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + */ + assistant_id: string; + thread?: CreateThreadRequest; + /** + * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + */ + model?: + | string + | 'gpt-5' + | 'gpt-5-mini' + | 'gpt-5-nano' + | 'gpt-5-2025-08-07' + | 'gpt-5-mini-2025-08-07' + | 'gpt-5-nano-2025-08-07' + | 'gpt-4.1' + | 'gpt-4.1-mini' + | 'gpt-4.1-nano' + | 'gpt-4.1-2025-04-14' + | 'gpt-4.1-mini-2025-04-14' + | 'gpt-4.1-nano-2025-04-14' + | 'gpt-4o' + | 'gpt-4o-2024-11-20' + | 'gpt-4o-2024-08-06' + | 'gpt-4o-2024-05-13' + | 'gpt-4o-mini' + | 'gpt-4o-mini-2024-07-18' + | 'gpt-4.5-preview' + | 'gpt-4.5-preview-2025-02-27' + | 'gpt-4-turbo' + | 'gpt-4-turbo-2024-04-09' + | 'gpt-4-0125-preview' + | 'gpt-4-turbo-preview' + | 'gpt-4-1106-preview' + | 'gpt-4-vision-preview' + | 'gpt-4' + | 'gpt-4-0314' + | 'gpt-4-0613' + | 'gpt-4-32k' + | 'gpt-4-32k-0314' + | 'gpt-4-32k-0613' + | 'gpt-3.5-turbo' + | 'gpt-3.5-turbo-16k' + | 'gpt-3.5-turbo-0613' + | 'gpt-3.5-turbo-1106' + | 'gpt-3.5-turbo-0125' + | 'gpt-3.5-turbo-16k-0613'; + /** + * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + */ + instructions?: string; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + /** + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; + }; + file_search?: { + /** + * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + * + */ + vector_store_ids?: Array; + }; + }; + metadata?: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + /** + * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. + * + */ + stream?: boolean; + /** + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_prompt_tokens?: number; + /** + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_completion_tokens?: number; + truncation_strategy?: TruncationObject & unknown; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + parallel_tool_calls?: ParallelToolCalls; + response_format?: AssistantsApiResponseFormatOption; }; /** - * Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint). + * Options to create a new thread. If no thread is provided when running a + * request, an empty thread will be created. * */ -export type CreateCompletionResponse = { - /** - * A unique identifier for the completion. - */ - id: string; - /** - * The list of completion choices the model generated for the input prompt. - */ - choices: Array<{ - /** - * The reason the model stopped generating tokens. This will be `stop` if the model hit a natural stop point or a provided stop sequence, - * `length` if the maximum number of tokens specified in the request was reached, - * or `content_filter` if content was omitted due to a flag from our content filters. - * - */ - finish_reason: 'stop' | 'length' | 'content_filter'; - index: number; - logprobs: { - text_offset?: Array; - token_logprobs?: Array; - tokens?: Array; - top_logprobs?: Array<{ - [key: string]: number; - }>; - }; - text: string; - }>; - /** - * The Unix timestamp (in seconds) of when the completion was created. - */ - created: number; - /** - * The model used for completion. - */ - model: string; - /** - * This fingerprint represents the backend configuration that the model runs with. - * - * Can be used in conjunction with the `seed` request parameter to understand when backend changes have been made that might impact determinism. - * - */ - system_fingerprint?: string; - /** - * The object type, which is always "text_completion" - */ - object: 'text_completion'; - usage?: CompletionUsage; +export type CreateThreadRequest = { + /** + * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. + */ + messages?: Array; + /** + * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; + }; + file_search?: unknown & { + /** + * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + * + */ + vector_store_ids?: Array; + /** + * A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread. + * + */ + vector_stores?: Array<{ + /** + * 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. + * + */ + file_ids?: Array; + /** + * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + */ + chunking_strategy?: + | { + /** + * Always `auto`. + */ + type: 'auto'; + } + | { + /** + * Always `static`. + */ + type: 'static'; + static: { + /** + * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + */ + max_chunk_size_tokens: number; + /** + * The number of tokens that overlap between chunks. The default value is `400`. + * + * Note that the overlap must not exceed half of `max_chunk_size_tokens`. + * + */ + chunk_overlap_tokens: number; + }; + }; + metadata?: Metadata; + }>; + }; + }; + metadata?: Metadata; }; -export type CreateContainerBody = { +export type CreateTranscriptionRequest = { + /** + * The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + * + */ + file: Blob | File; + /** + * ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model). + * + */ + model: string | 'whisper-1' | 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe'; + /** + * The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. + * + */ + language?: string; + /** + * An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. + * + */ + prompt?: string; + response_format?: AudioResponseFormat; + /** + * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. + * + */ + temperature?: number; + /** + * If set to true, the model response data will be streamed to the client + * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + * See the [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) + * for more information. + * + * Note: Streaming is not supported for the `whisper-1` model and will be ignored. + * + */ + stream?: boolean; + chunking_strategy?: TranscriptionChunkingStrategy; + /** + * The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. + * + */ + timestamp_granularities?: Array<'word' | 'segment'>; + /** + * Additional information to include in the transcription response. + * `logprobs` will return the log probabilities of the tokens in the + * response to understand the model's confidence in the transcription. + * `logprobs` only works with response_format set to `json` and only with + * the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. + * + */ + include?: Array; +}; + +/** + * Represents a transcription response returned by model, based on the provided input. + */ +export type CreateTranscriptionResponseJson = { + /** + * The transcribed text. + */ + text: string; + /** + * The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array. + * + */ + logprobs?: Array<{ /** - * Name of the container to create. + * The token in the transcription. */ - name: string; + token?: string; /** - * IDs of files to copy to the container. + * The log probability of the token. */ - file_ids?: Array; + logprob?: number; /** - * Container expiration time in seconds relative to the 'anchor' time. + * The bytes of the token. */ - expires_after?: { - /** - * Time anchor for the expiration time. Currently only 'last_active_at' is supported. - */ - anchor: 'last_active_at'; - minutes: number; - }; + bytes?: Array; + }>; + /** + * Token usage statistics for the request. + */ + usage?: + | ({ + type?: 'TranscriptTextUsageTokens'; + } & TranscriptTextUsageTokens) + | ({ + type?: 'TranscriptTextUsageDuration'; + } & TranscriptTextUsageDuration); }; -export type CreateContainerFileBody = { - /** - * Name of the file to create. - */ - file_id?: string; - /** - * The File object (not file name) to be uploaded. - * - */ - file?: Blob | File; +export type CreateTranscriptionResponseStreamEvent = + | ({ + type?: 'TranscriptTextDeltaEvent'; + } & TranscriptTextDeltaEvent) + | ({ + type?: 'TranscriptTextDoneEvent'; + } & TranscriptTextDoneEvent); + +/** + * Represents a verbose json transcription response returned by model, based on the provided input. + */ +export type CreateTranscriptionResponseVerboseJson = { + /** + * The language of the input audio. + */ + language: string; + /** + * The duration of the input audio. + */ + duration: number; + /** + * The transcribed text. + */ + text: string; + /** + * Extracted words and their corresponding timestamps. + */ + words?: Array; + /** + * Segments of the transcribed text and their corresponding details. + */ + segments?: Array; + usage?: TranscriptTextUsageDuration; }; -export type CreateEmbeddingRequest = { - /** - * Input text to embed, encoded as a string or array of tokens. To embed multiple inputs in a single request, pass an array of strings or array of token arrays. The input must not exceed the max input tokens for the model (8192 tokens for all embedding models), cannot be an empty string, and any array must be 2048 dimensions or less. [Example Python code](https://cookbook.openai.com/examples/how_to_count_tokens_with_tiktoken) for counting tokens. In addition to the per-input token limit, all embedding models enforce a maximum of 300,000 tokens summed across all inputs in a single request. - * - */ - input: string | Array | Array | Array>; - /** - * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - * - */ - model: string | 'text-embedding-ada-002' | 'text-embedding-3-small' | 'text-embedding-3-large'; - /** - * The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). - */ - encoding_format?: 'float' | 'base64'; - /** - * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. - * - */ - dimensions?: number; - /** - * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). - * - */ - user?: string; +export type CreateTranslationRequest = { + /** + * The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. + * + */ + file: Blob | File; + /** + * ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available. + * + */ + model: string | 'whisper-1'; + /** + * An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English. + * + */ + prompt?: string; + /** + * The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. + * + */ + response_format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt'; + /** + * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. + * + */ + temperature?: number; }; -export type CreateEmbeddingResponse = { - /** - * The list of embeddings generated by the model. - */ - data: Array; - /** - * The name of the model used to generate the embedding. - */ - model: string; - /** - * The object type, which is always "list". - */ - object: 'list'; - /** - * The usage information for the request. - */ - usage: { - /** - * The number of tokens used by the prompt. - */ - prompt_tokens: number; - /** - * The total number of tokens used by the request. - */ - total_tokens: number; - }; +export type CreateTranslationResponseJson = { + text: string; +}; + +export type CreateTranslationResponseVerboseJson = { + /** + * The language of the output translation (always `english`). + */ + language: string; + /** + * The duration of the input audio. + */ + duration: number; + /** + * The translated text. + */ + text: string; + /** + * Segments of the translated text and their corresponding details. + */ + segments?: Array; +}; + +export type CreateUploadRequest = { + /** + * The name of the file to upload. + * + */ + filename: string; + /** + * The intended purpose of the uploaded file. + * + * See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). + * + */ + purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision'; + /** + * The number of bytes in the file you are uploading. + * + */ + bytes: number; + /** + * The MIME type of the file. + * + * This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision. + * + */ + mime_type: string; + expires_after?: FileExpirationAfter; +}; + +export type CreateVectorStoreFileBatchRequest = { + /** + * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. + */ + file_ids: Array; + chunking_strategy?: ChunkingStrategyRequestParam; + attributes?: VectorStoreFileAttributes; +}; + +export type CreateVectorStoreFileRequest = { + /** + * A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. + */ + file_id: string; + chunking_strategy?: ChunkingStrategyRequestParam; + attributes?: VectorStoreFileAttributes; +}; + +export type CreateVectorStoreRequest = { + /** + * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. + */ + file_ids?: Array; + /** + * The name of the vector store. + */ + name?: string; + expires_after?: VectorStoreExpirationAfter; + chunking_strategy?: ChunkingStrategyRequestParam; + metadata?: Metadata; }; /** - * CompletionsRunDataSource + * Custom tool * - * A CompletionsRunDataSource object describing a model sampling configuration. + * A custom tool that processes input using a specified format. Learn more about + * [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools). * */ -export type CreateEvalCompletionsRunDataSource = { - /** - * The type of run data source. Always `completions`. - */ - type: 'completions'; - /** - * Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. - */ - input_messages?: { - /** - * The type of input messages. Always `template`. - */ - type: 'template'; - /** - * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. - */ - template: Array<({ - type?: 'EasyInputMessage'; - } & EasyInputMessage) | ({ - type?: 'EvalItem'; - } & EvalItem)>; - } | { - /** - * The type of input messages. Always `item_reference`. - */ - type: 'item_reference'; - /** - * A reference to a variable in the `item` namespace. Ie, "item.input_trajectory" - */ - item_reference: string; - }; - sampling_params?: { - /** - * A higher temperature increases randomness in the outputs. - */ - temperature?: number; - /** - * The maximum number of tokens in the generated output. - */ - max_completion_tokens?: number; +export type CustomTool = { + /** + * The type of the custom tool. Always `custom`. + */ + type: 'custom'; + /** + * The name of the custom tool, used to identify it in tool calls. + */ + name: string; + /** + * Optional description of the custom tool, used to provide more context. + * + */ + description?: string; + /** + * The input format for the custom tool. Default is unconstrained text. + * + */ + format?: + | { /** - * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + * Unconstrained text format. Always `text`. */ - top_p?: number; + type: 'text'; + } + | { /** - * A seed value to initialize the randomness, during sampling. + * Grammar format. Always `grammar`. */ - seed?: number; + type: 'grammar'; /** - * An object specifying the format that the model must output. - * - * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables - * Structured Outputs which ensures the model will match your supplied JSON - * schema. Learn more in the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). - * - * Setting to `{ "type": "json_object" }` enables the older JSON mode, which - * ensures the message the model generates is valid JSON. Using `json_schema` - * is preferred for models that support it. - * + * The grammar definition. */ - response_format?: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject; + definition: string; /** - * A list of tools the model may call. Currently, only functions are supported as a tool. Use this to provide a list of functions the model may generate JSON inputs for. A max of 128 functions are supported. - * + * The syntax of the grammar definition. One of `lark` or `regex`. */ - tools?: Array; - }; - /** - * The name of the model to use for generating completions (e.g. "o3-mini"). - */ - model?: string; - /** - * Determines what populates the `item` namespace in this run's data source. - */ - source: ({ - type?: 'EvalJsonlFileContentSource'; - } & EvalJsonlFileContentSource) | ({ - type?: 'EvalJsonlFileIdSource'; - } & EvalJsonlFileIdSource) | ({ - type?: 'EvalStoredCompletionsSource'; - } & EvalStoredCompletionsSource); + syntax: 'lark' | 'regex'; + }; }; /** - * CustomDataSourceConfig + * Custom tool call * - * A CustomDataSourceConfig object that defines the schema for the data source used for the evaluation runs. - * This schema is used to define the shape of the data that will be: - * - Used to define your testing criteria and - * - What data is required when creating a run + * A call to a custom tool created by the model. * */ -export type CreateEvalCustomDataSourceConfig = { - /** - * The type of data source. Always `custom`. - */ - type: 'custom'; - /** - * The json schema for each row in the data source. - */ - item_schema: { - [key: string]: unknown; - }; - /** - * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) - */ - include_sample_schema?: boolean; +export type CustomToolCall = { + /** + * The type of the custom tool call. Always `custom_tool_call`. + * + */ + type: 'custom_tool_call'; + /** + * The unique ID of the custom tool call in the OpenAI platform. + * + */ + id?: string; + /** + * An identifier used to map this custom tool call to a tool call output. + * + */ + call_id: string; + /** + * The name of the custom tool being called. + * + */ + name: string; + /** + * The input for the custom tool call generated by the model. + * + */ + input: string; }; /** - * CreateEvalItem - * - * A chat message that makes up the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. - */ -export type CreateEvalItem = { - /** - * The role of the message (e.g. "system", "assistant", "user"). - */ - role: string; - /** - * The content of the message. - */ - content: string; -} | EvalItem; - -/** - * JsonlRunDataSource + * Custom tool call output * - * A JsonlRunDataSource object with that specifies a JSONL file that matches the eval + * The output of a custom tool call from your code, being sent back to the model. * */ -export type CreateEvalJsonlRunDataSource = { - /** - * The type of data source. Always `jsonl`. - */ - type: 'jsonl'; - /** - * Determines what populates the `item` namespace in the data source. - */ - source: ({ - type?: 'EvalJsonlFileContentSource'; - } & EvalJsonlFileContentSource) | ({ - type?: 'EvalJsonlFileIdSource'; - } & EvalJsonlFileIdSource); +export type CustomToolCallOutput = { + /** + * The type of the custom tool call output. Always `custom_tool_call_output`. + * + */ + type: 'custom_tool_call_output'; + /** + * The unique ID of the custom tool call output in the OpenAI platform. + * + */ + id?: string; + /** + * The call ID, used to map this custom tool call output to a custom tool call. + * + */ + call_id: string; + /** + * The output from the custom tool call generated by your code. + * + */ + output: string; }; /** - * LabelModelGrader + * Custom tool * - * A LabelModelGrader object which uses a model to assign labels to each item - * in the evaluation. + * A custom tool that processes input using a specified format. * */ -export type CreateEvalLabelModelGrader = { - /** - * The object type, which is always `label_model`. - */ - type: 'label_model'; +export type CustomToolChatCompletions = { + /** + * The type of the custom tool. Always `custom`. + */ + type: 'custom'; + /** + * Custom tool properties + * + * Properties of the custom tool. + * + */ + custom: { /** - * The name of the grader. + * The name of the custom tool, used to identify it in tool calls. */ name: string; /** - * The model to use for the evaluation. Must support structured outputs. - */ - model: string; - /** - * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. - */ - input: Array; - /** - * The labels to classify to each item in the evaluation. + * Optional description of the custom tool, used to provide more context. + * */ - labels: Array; + description?: string; /** - * The labels that indicate a passing result. Must be a subset of labels. + * The input format for the custom tool. Default is unconstrained text. + * */ - passing_labels: Array; + format?: + | { + /** + * Unconstrained text format. Always `text`. + */ + type: 'text'; + } + | { + /** + * Grammar format. Always `grammar`. + */ + type: 'grammar'; + /** + * Grammar format + * + * Your chosen grammar. + */ + grammar: { + /** + * The grammar definition. + */ + definition: string; + /** + * The syntax of the grammar definition. One of `lark` or `regex`. + */ + syntax: 'lark' | 'regex'; + }; + }; + }; +}; + +export type DeleteAssistantResponse = { + id: string; + deleted: boolean; + object: 'assistant.deleted'; +}; + +export type DeleteCertificateResponse = { + /** + * The object type, must be `certificate.deleted`. + */ + object: 'certificate.deleted'; + /** + * The ID of the certificate that was deleted. + */ + id: string; +}; + +export type DeleteFileResponse = { + id: string; + object: 'file'; + deleted: boolean; +}; + +export type DeleteFineTuningCheckpointPermissionResponse = { + /** + * The ID of the fine-tuned model checkpoint permission that was deleted. + */ + id: string; + /** + * The object type, which is always "checkpoint.permission". + */ + object: 'checkpoint.permission'; + /** + * Whether the fine-tuned model checkpoint permission was successfully deleted. + */ + deleted: boolean; +}; + +export type DeleteMessageResponse = { + id: string; + deleted: boolean; + object: 'thread.message.deleted'; +}; + +export type DeleteModelResponse = { + id: string; + deleted: boolean; + object: string; +}; + +export type DeleteThreadResponse = { + id: string; + deleted: boolean; + object: 'thread.deleted'; +}; + +export type DeleteVectorStoreFileResponse = { + id: string; + deleted: boolean; + object: 'vector_store.file.deleted'; +}; + +export type DeleteVectorStoreResponse = { + id: string; + deleted: boolean; + object: 'vector_store.deleted'; }; /** - * LogsDataSourceConfig + * Occurs when a stream ends. + */ +export type DoneEvent = { + event: 'done'; + data: '[DONE]'; +}; + +/** + * DoubleClick * - * A data source config which specifies the metadata property of your logs query. - * This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. + * A double click action. * */ -export type CreateEvalLogsDataSourceConfig = { - /** - * The type of data source. Always `logs`. - */ - type: 'logs'; - /** - * Metadata filters for the logs data source. - */ - metadata?: { - [key: string]: unknown; - }; +export type DoubleClick = { + /** + * Specifies the event type. For a double click action, this property is + * always set to `double_click`. + * + */ + type: 'double_click'; + /** + * The x-coordinate where the double click occurred. + * + */ + x: number; + /** + * The y-coordinate where the double click occurred. + * + */ + y: number; }; /** - * CreateEvalRequest + * Drag + * + * A drag action. + * */ -export type CreateEvalRequest = { - /** - * The name of the evaluation. - */ - name?: string; - metadata?: Metadata; - /** - * The configuration for the data source used for the evaluation runs. Dictates the schema of the data used in the evaluation. - */ - data_source_config: ({ - type?: 'CreateEvalCustomDataSourceConfig'; - } & CreateEvalCustomDataSourceConfig) | ({ - type?: 'CreateEvalLogsDataSourceConfig'; - } & CreateEvalLogsDataSourceConfig) | ({ - type?: 'CreateEvalStoredCompletionsDataSourceConfig'; - } & CreateEvalStoredCompletionsDataSourceConfig); - /** - * A list of graders for all eval runs in this group. Graders can reference variables in the data source using double curly braces notation, like `{{item.variable_name}}`. To reference the model's output, use the `sample` namespace (ie, `{{sample.output_text}}`). - */ - testing_criteria: Array<({ - type?: 'CreateEvalLabelModelGrader'; - } & CreateEvalLabelModelGrader) | ({ - type?: 'EvalGraderStringCheck'; - } & EvalGraderStringCheck) | ({ - type?: 'EvalGraderTextSimilarity'; - } & EvalGraderTextSimilarity) | ({ - type?: 'EvalGraderPython'; - } & EvalGraderPython) | ({ - type?: 'EvalGraderScoreModel'; - } & EvalGraderScoreModel)>; +export type Drag = { + /** + * Specifies the event type. For a drag action, this property is + * always set to `drag`. + * + */ + type: 'drag'; + /** + * An array of coordinates representing the path of the drag action. Coordinates will appear as an array + * of objects, eg + * ``` + * [ + * { x: 100, y: 200 }, + * { x: 200, y: 300 } + * ] + * ``` + * + */ + path: Array; }; /** - * ResponsesRunDataSource + * Input message * - * A ResponsesRunDataSource object describing a model sampling configuration. + * A message input to the model with a role indicating instruction following + * hierarchy. Instructions given with the `developer` or `system` role take + * precedence over instructions given with the `user` role. Messages with the + * `assistant` role are presumed to have been generated by the model in previous + * interactions. * */ -export type CreateEvalResponsesRunDataSource = { - /** - * The type of run data source. Always `responses`. - */ - type: 'responses'; - /** - * Used when sampling from a model. Dictates the structure of the messages passed into the model. Can either be a reference to a prebuilt trajectory (ie, `item.input_trajectory`), or a template with variable references to the `item` namespace. - */ - input_messages?: { - /** - * The type of input messages. Always `template`. - */ - type: 'template'; - /** - * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. - */ - template: Array<{ - /** - * The role of the message (e.g. "system", "assistant", "user"). - */ - role: string; - /** - * The content of the message. - */ - content: string; - } | EvalItem>; - } | { - /** - * The type of input messages. Always `item_reference`. - */ - type: 'item_reference'; - /** - * A reference to a variable in the `item` namespace. Ie, "item.name" - */ - item_reference: string; - }; - sampling_params?: { - /** - * A higher temperature increases randomness in the outputs. - */ - temperature?: number; +export type EasyInputMessage = { + /** + * The role of the message input. One of `user`, `assistant`, `system`, or + * `developer`. + * + */ + role: 'user' | 'assistant' | 'system' | 'developer'; + /** + * Text, image, or audio input to the model, used to generate a response. + * Can also contain previous assistant responses. + * + */ + content: string | InputMessageContentList; + /** + * The type of the message input. Always `message`. + * + */ + type?: 'message'; +}; + +/** + * Represents an embedding vector returned by embedding endpoint. + * + */ +export type Embedding = { + /** + * The index of the embedding in the list of embeddings. + */ + index: number; + /** + * The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings). + * + */ + embedding: Array; + /** + * The object type, which is always "embedding". + */ + object: 'embedding'; +}; + +export type Error = { + code: string; + message: string; + param: string; + type: string; +}; + +/** + * Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. + */ +export type ErrorEvent = { + event: 'error'; + data: Error; +}; + +export type ErrorResponse = { + error: Error; +}; + +/** + * Eval + * + * An Eval object with a data source config and testing criteria. + * An Eval represents a task to be done for your LLM integration. + * Like: + * - Improve the quality of my chatbot + * - See how well my chatbot handles customer support + * - Check if o4-mini is better at my usecase than gpt-4o + * + */ +export type Eval = { + /** + * The object type. + */ + object: 'eval'; + /** + * Unique identifier for the evaluation. + */ + id: string; + /** + * The name of the evaluation. + */ + name: string; + /** + * Configuration of data sources used in runs of the evaluation. + */ + data_source_config: + | ({ + type?: 'EvalCustomDataSourceConfig'; + } & EvalCustomDataSourceConfig) + | ({ + type?: 'EvalLogsDataSourceConfig'; + } & EvalLogsDataSourceConfig) + | ({ + type?: 'EvalStoredCompletionsDataSourceConfig'; + } & EvalStoredCompletionsDataSourceConfig); + /** + * A list of testing criteria. + */ + testing_criteria: Array< + | EvalGraderLabelModel + | EvalGraderStringCheck + | EvalGraderTextSimilarity + | EvalGraderPython + | EvalGraderScoreModel + >; + /** + * The Unix timestamp (in seconds) for when the eval was created. + */ + created_at: number; + metadata: Metadata; +}; + +/** + * EvalApiError + * + * An object representing an error response from the Eval API. + * + */ +export type EvalApiError = { + /** + * The error code. + */ + code: string; + /** + * The error message. + */ + message: string; +}; + +/** + * CustomDataSourceConfig + * + * A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces. + * The response schema defines the shape of the data that will be: + * - Used to define your testing criteria and + * - What data is required when creating a run + * + */ +export type EvalCustomDataSourceConfig = { + /** + * The type of data source. Always `custom`. + */ + type: 'custom'; + /** + * The json schema for the run data source items. + * Learn how to build JSON schemas [here](https://json-schema.org/). + * + */ + schema: { + [key: string]: unknown; + }; +}; + +/** + * LabelModelGrader + */ +export type EvalGraderLabelModel = GraderLabelModel; + +/** + * PythonGrader + */ +export type EvalGraderPython = GraderPython & { + /** + * The threshold for the score. + */ + pass_threshold?: number; +}; + +/** + * ScoreModelGrader + */ +export type EvalGraderScoreModel = GraderScoreModel & { + /** + * The threshold for the score. + */ + pass_threshold?: number; +}; + +/** + * StringCheckGrader + */ +export type EvalGraderStringCheck = GraderStringCheck; + +/** + * TextSimilarityGrader + */ +export type EvalGraderTextSimilarity = GraderTextSimilarity & { + /** + * The threshold for the score. + */ + pass_threshold: number; +}; + +/** + * Eval message object + * + * A message input to the model with a role indicating instruction following + * hierarchy. Instructions given with the `developer` or `system` role take + * precedence over instructions given with the `user` role. Messages with the + * `assistant` role are presumed to have been generated by the model in previous + * interactions. + * + */ +export type EvalItem = { + /** + * The role of the message input. One of `user`, `assistant`, `system`, or + * `developer`. + * + */ + role: 'user' | 'assistant' | 'system' | 'developer'; + /** + * Inputs to the model - can contain template strings. + * + */ + content: + | string + | InputTextContent + | { /** - * The maximum number of tokens in the generated output. + * The type of the output text. Always `output_text`. + * */ - max_completion_tokens?: number; + type: 'output_text'; /** - * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + * The text output from the model. + * */ - top_p?: number; + text: string; + } + | { /** - * A seed value to initialize the randomness, during sampling. + * The type of the image input. Always `input_image`. + * */ - seed?: number; + type: 'input_image'; /** - * An array of tools the model may call while generating a response. You - * can specify which tool to use by setting the `tool_choice` parameter. - * - * The two categories of tools you can provide the model are: - * - * - **Built-in tools**: Tools that are provided by OpenAI that extend the - * model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - * or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - * - **Function calls (custom tools)**: Functions that are defined by you, - * enabling the model to call your own code. Learn more about - * [function calling](https://platform.openai.com/docs/guides/function-calling). + * The URL of the image input. * */ - tools?: Array; + image_url: string; /** - * Configuration options for a text response from the model. Can be plain - * text or structured JSON data. Learn more: - * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. * */ - text?: { - format?: TextResponseFormatConfiguration; - }; + detail?: string; + } + | Array; + /** + * The type of the message input. Always `message`. + * + */ + type?: 'message'; +}; + +/** + * EvalJsonlFileContentSource + */ +export type EvalJsonlFileContentSource = { + /** + * The type of jsonl source. Always `file_content`. + */ + type: 'file_content'; + /** + * The content of the jsonl file. + */ + content: Array<{ + item: { + [key: string]: unknown; }; - /** - * The name of the model to use for generating completions (e.g. "o3-mini"). - */ - model?: string; - /** - * Determines what populates the `item` namespace in this run's data source. - */ - source: ({ - type?: 'EvalJsonlFileContentSource'; - } & EvalJsonlFileContentSource) | ({ - type?: 'EvalJsonlFileIdSource'; - } & EvalJsonlFileIdSource) | ({ - type?: 'EvalResponsesSource'; - } & EvalResponsesSource); + sample?: { + [key: string]: unknown; + }; + }>; }; /** - * CreateEvalRunRequest + * EvalJsonlFileIdSource */ -export type CreateEvalRunRequest = { - /** - * The name of the run. - */ - name?: string; - metadata?: Metadata; - /** - * Details about the run's data source. - */ - data_source: CreateEvalJsonlRunDataSource | CreateEvalCompletionsRunDataSource | CreateEvalResponsesRunDataSource; +export type EvalJsonlFileIdSource = { + /** + * The type of jsonl source. Always `file_id`. + */ + type: 'file_id'; + /** + * The identifier of the file. + */ + id: string; }; /** - * StoredCompletionsDataSourceConfig + * EvalList * - * Deprecated in favor of LogsDataSourceConfig. + * An object representing a list of evals. * + */ +export type EvalList = { + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; + /** + * An array of eval objects. + * + */ + data: Array; + /** + * The identifier of the first eval in the data array. + */ + first_id: string; + /** + * The identifier of the last eval in the data array. + */ + last_id: string; + /** + * Indicates whether there are more evals available. + */ + has_more: boolean; +}; + +/** + * LogsDataSourceConfig + * + * A LogsDataSourceConfig which specifies the metadata property of your logs query. + * This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. + * The schema returned by this data source config is used to defined what variables are available in your evals. + * `item` and `sample` are both defined when using this data source config. * - * @deprecated */ -export type CreateEvalStoredCompletionsDataSourceConfig = { +export type EvalLogsDataSourceConfig = { + /** + * The type of data source. Always `logs`. + */ + type: 'logs'; + metadata?: Metadata; + /** + * The json schema for the run data source items. + * Learn how to build JSON schemas [here](https://json-schema.org/). + * + */ + schema: { + [key: string]: unknown; + }; +}; + +/** + * EvalResponsesSource + * + * A EvalResponsesSource object describing a run data source configuration. + * + */ +export type EvalResponsesSource = { + /** + * The type of run data source. Always `responses`. + */ + type: 'responses'; + /** + * Metadata filter for the responses. This is a query parameter used to select responses. + */ + metadata?: { + [key: string]: unknown; + }; + /** + * The name of the model to find responses for. This is a query parameter used to select responses. + */ + model?: string; + /** + * Optional string to search the 'instructions' field. This is a query parameter used to select responses. + */ + instructions_search?: string; + /** + * Only include items created after this timestamp (inclusive). This is a query parameter used to select responses. + */ + created_after?: number; + /** + * Only include items created before this timestamp (inclusive). This is a query parameter used to select responses. + */ + created_before?: number; + /** + * Optional reasoning effort parameter. This is a query parameter used to select responses. + */ + reasoning_effort?: ReasoningEffort; + /** + * Sampling temperature. This is a query parameter used to select responses. + */ + temperature?: number; + /** + * Nucleus sampling parameter. This is a query parameter used to select responses. + */ + top_p?: number; + /** + * List of user identifiers. This is a query parameter used to select responses. + */ + users?: Array; + /** + * List of tool names. This is a query parameter used to select responses. + */ + tools?: Array; +}; + +/** + * EvalRun + * + * A schema representing an evaluation run. + * + */ +export type EvalRun = { + /** + * The type of the object. Always "eval.run". + */ + object: 'eval.run'; + /** + * Unique identifier for the evaluation run. + */ + id: string; + /** + * The identifier of the associated evaluation. + */ + eval_id: string; + /** + * The status of the evaluation run. + */ + status: string; + /** + * The model that is evaluated, if applicable. + */ + model: string; + /** + * The name of the evaluation run. + */ + name: string; + /** + * Unix timestamp (in seconds) when the evaluation run was created. + */ + created_at: number; + /** + * The URL to the rendered evaluation run report on the UI dashboard. + */ + report_url: string; + /** + * Counters summarizing the outcomes of the evaluation run. + */ + result_counts: { + /** + * Total number of executed output items. + */ + total: number; /** - * The type of data source. Always `stored_completions`. + * Number of output items that resulted in an error. */ - type: 'stored_completions'; + errored: number; /** - * Metadata filters for the stored completions data source. + * Number of output items that failed to pass the evaluation. */ - metadata?: { - [key: string]: unknown; - }; -}; - -export type CreateFileRequest = { + failed: number; /** - * The File object (not file name) to be uploaded. - * + * Number of output items that passed the evaluation. */ - file: Blob | File; - purpose: FilePurpose; - expires_after?: FileExpirationAfter; -}; - -export type CreateFineTuningCheckpointPermissionRequest = { + passed: number; + }; + /** + * Usage statistics for each model during the evaluation run. + */ + per_model_usage: Array<{ /** - * The project identifiers to grant access to. + * The name of the model. */ - project_ids: Array; -}; - -export type CreateFineTuningJobRequest = { + model_name: string; /** - * The name of the model to fine-tune. You can select one of the - * [supported models](https://platform.openai.com/docs/guides/fine-tuning#which-models-can-be-fine-tuned). - * + * The number of invocations. */ - model: string | 'babbage-002' | 'davinci-002' | 'gpt-3.5-turbo' | 'gpt-4o-mini'; + invocation_count: number; /** - * The ID of an uploaded file that contains training data. - * - * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. - * - * Your dataset must be formatted as a JSONL file. Additionally, you must upload your file with the purpose `fine-tune`. - * - * The contents of the file should differ depending on if the model uses the [chat](https://platform.openai.com/docs/api-reference/fine-tuning/chat-input), [completions](https://platform.openai.com/docs/api-reference/fine-tuning/completions-input) format, or if the fine-tuning method uses the [preference](https://platform.openai.com/docs/api-reference/fine-tuning/preference-input) format. - * - * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. - * + * The number of prompt tokens used. */ - training_file: string; + prompt_tokens: number; /** - * The hyperparameters used for the fine-tuning job. - * This value is now deprecated in favor of `method`, and should be passed in under the `method` parameter. - * - * - * @deprecated + * The number of completion tokens generated. */ - hyperparameters?: { - /** - * Number of examples in each batch. A larger batch size means that model parameters - * are updated less frequently, but with lower variance. - * - */ - batch_size?: 'auto' | number; - /** - * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid - * overfitting. - * - */ - learning_rate_multiplier?: 'auto' | number; - /** - * The number of epochs to train the model for. An epoch refers to one full cycle - * through the training dataset. - * - */ - n_epochs?: 'auto' | number; - }; + completion_tokens: number; /** - * A string of up to 64 characters that will be added to your fine-tuned model name. - * - * For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. - * + * The total number of tokens used. */ - suffix?: string; + total_tokens: number; /** - * The ID of an uploaded file that contains validation data. - * - * If you provide this file, the data is used to generate validation - * metrics periodically during fine-tuning. These metrics can be viewed in - * the fine-tuning results file. - * The same data should not be present in both train and validation files. - * - * Your dataset must be formatted as a JSONL file. You must upload your file with the purpose `fine-tune`. - * - * See the [fine-tuning guide](https://platform.openai.com/docs/guides/model-optimization) for more details. - * + * The number of tokens retrieved from cache. */ - validation_file?: string; + cached_tokens: number; + }>; + /** + * Results per testing criteria applied during the evaluation run. + */ + per_testing_criteria_results: Array<{ /** - * A list of integrations to enable for your fine-tuning job. + * A description of the testing criteria. */ - integrations?: Array<{ - /** - * The type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported. - * - */ - type: 'wandb'; - /** - * The settings for your integration with Weights and Biases. This payload specifies the project that - * metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags - * to your run, and set a default entity (team, username, etc) to be associated with your run. - * - */ - wandb: { - /** - * The name of the project that the new run will be created under. - * - */ - project: string; - /** - * A display name to set for the run. If not set, we will use the Job ID as the name. - * - */ - name?: string; - /** - * The entity to use for the run. This allows you to set the team or username of the WandB user that you would - * like associated with the run. If not set, the default entity for the registered WandB API key is used. - * - */ - entity?: string; - /** - * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some - * default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". - * - */ - tags?: Array; - }; - }>; + testing_criteria: string; /** - * The seed controls the reproducibility of the job. Passing in the same seed and job parameters should produce the same results, but may differ in rare cases. - * If a seed is not specified, one will be generated for you. - * + * Number of tests passed for this criteria. */ - seed?: number; - method?: FineTuneMethod; - metadata?: Metadata; + passed: number; + /** + * Number of tests failed for this criteria. + */ + failed: number; + }>; + /** + * Information about the run's data source. + */ + data_source: + | ({ + type?: 'CreateEvalJsonlRunDataSource'; + } & CreateEvalJsonlRunDataSource) + | ({ + type?: 'CreateEvalCompletionsRunDataSource'; + } & CreateEvalCompletionsRunDataSource) + | ({ + type?: 'CreateEvalResponsesRunDataSource'; + } & CreateEvalResponsesRunDataSource); + metadata: Metadata; + error: EvalApiError; }; -export type CreateImageEditRequest = { +/** + * EvalRunList + * + * An object representing a list of runs for an evaluation. + * + */ +export type EvalRunList = { + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; + /** + * An array of eval run objects. + * + */ + data: Array; + /** + * The identifier of the first eval run in the data array. + */ + first_id: string; + /** + * The identifier of the last eval run in the data array. + */ + last_id: string; + /** + * Indicates whether there are more evals available. + */ + has_more: boolean; +}; + +/** + * EvalRunOutputItem + * + * A schema representing an evaluation run output item. + * + */ +export type EvalRunOutputItem = { + /** + * The type of the object. Always "eval.run.output_item". + */ + object: 'eval.run.output_item'; + /** + * Unique identifier for the evaluation run output item. + */ + id: string; + /** + * The identifier of the evaluation run associated with this output item. + */ + run_id: string; + /** + * The identifier of the evaluation group. + */ + eval_id: string; + /** + * Unix timestamp (in seconds) when the evaluation run was created. + */ + created_at: number; + /** + * The status of the evaluation run. + */ + status: string; + /** + * The identifier for the data source item. + */ + datasource_item_id: number; + /** + * Details of the input data source item. + */ + datasource_item: { + [key: string]: unknown; + }; + /** + * A list of results from the evaluation run. + */ + results: Array<{ + [key: string]: unknown; + }>; + /** + * A sample containing the input and output of the evaluation run. + */ + sample: { + /** + * An array of input messages. + */ + input: Array<{ + /** + * The role of the message sender (e.g., system, user, developer). + */ + role: string; + /** + * The content of the message. + */ + content: string; + }>; /** - * The image(s) to edit. Must be a supported image file or an array of images. - * - * For `gpt-image-1`, each image should be a `png`, `webp`, or `jpg` file less - * than 50MB. You can provide up to 16 images. - * - * For `dall-e-2`, you can only provide one image, and it should be a square - * `png` file less than 4MB. - * - */ - image: Blob | File | Array; + * An array of output messages. + */ + output: Array<{ + /** + * The role of the message (e.g. "system", "assistant", "user"). + */ + role?: string; + /** + * The content of the message. + */ + content?: string; + }>; /** - * A text description of the desired image(s). The maximum length is 1000 characters for `dall-e-2`, and 32000 characters for `gpt-image-1`. + * The reason why the sample generation was finished. */ - prompt: string; + finish_reason: string; /** - * An additional image whose fully transparent areas (e.g. where alpha is zero) indicate where `image` should be edited. If there are multiple images provided, the mask will be applied on the first image. Must be a valid PNG file, less than 4MB, and have the same dimensions as `image`. + * The model used for generating the sample. */ - mask?: Blob | File; + model: string; /** - * Allows to set transparency for the background of the generated image(s). - * This parameter is only supported for `gpt-image-1`. Must be one of - * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the - * model will automatically determine the best background for the image. - * - * If `transparent`, the output format needs to support transparency, so it - * should be set to either `png` (default value) or `webp`. - * + * Token usage details for the sample. */ - background?: 'transparent' | 'opaque' | 'auto'; + usage: { + /** + * The total number of tokens used. + */ + total_tokens: number; + /** + * The number of completion tokens generated. + */ + completion_tokens: number; + /** + * The number of prompt tokens used. + */ + prompt_tokens: number; + /** + * The number of tokens retrieved from cache. + */ + cached_tokens: number; + }; + error: EvalApiError; /** - * The model to use for image generation. Only `dall-e-2` and `gpt-image-1` are supported. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used. + * The sampling temperature used. */ - model?: string | 'dall-e-2' | 'gpt-image-1'; + temperature: number; /** - * The number of images to generate. Must be between 1 and 10. + * The maximum number of tokens allowed for completion. */ - n?: number; + max_completion_tokens: number; /** - * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, and one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`. + * The top_p value used for sampling. */ - size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto'; + top_p: number; /** - * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter is only supported for `dall-e-2`, as `gpt-image-1` will always return base64-encoded images. + * The seed used for generating the sample. */ - response_format?: 'url' | 'b64_json'; - /** - * The format in which the generated images are returned. This parameter is - * only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. - * The default value is `png`. + seed: number; + }; +}; + +/** + * EvalRunOutputItemList + * + * An object representing a list of output items for an evaluation run. + * + */ +export type EvalRunOutputItemList = { + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; + /** + * An array of eval run output item objects. + * + */ + data: Array; + /** + * The identifier of the first eval run output item in the data array. + */ + first_id: string; + /** + * The identifier of the last eval run output item in the data array. + */ + last_id: string; + /** + * Indicates whether there are more eval run output items available. + */ + has_more: boolean; +}; + +/** + * StoredCompletionsDataSourceConfig + * + * Deprecated in favor of LogsDataSourceConfig. + * + * + * @deprecated + */ +export type EvalStoredCompletionsDataSourceConfig = { + /** + * The type of data source. Always `stored_completions`. + */ + type: 'stored_completions'; + metadata?: Metadata; + /** + * The json schema for the run data source items. + * Learn how to build JSON schemas [here](https://json-schema.org/). + * + */ + schema: { + [key: string]: unknown; + }; +}; + +/** + * StoredCompletionsRunDataSource + * + * A StoredCompletionsRunDataSource configuration describing a set of filters + * + */ +export type EvalStoredCompletionsSource = { + /** + * The type of source. Always `stored_completions`. + */ + type: 'stored_completions'; + metadata?: Metadata; + /** + * An optional model to filter by (e.g., 'gpt-4o'). + */ + model?: string; + /** + * An optional Unix timestamp to filter items created after this time. + */ + created_after?: number; + /** + * An optional Unix timestamp to filter items created before this time. + */ + created_before?: number; + /** + * An optional maximum number of items to return. + */ + limit?: number; +}; + +/** + * File expiration policy + * + * The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted. + */ +export type FileExpirationAfter = { + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. + */ + anchor: 'created_at'; + /** + * The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). + */ + seconds: number; +}; + +/** + * File path + * + * A path to a file. + * + */ +export type FilePath = { + /** + * The type of the file path. Always `file_path`. + * + */ + type: 'file_path'; + /** + * The ID of the file. + * + */ + file_id: string; + /** + * The index of the file in the list of files. + * + */ + index: number; +}; + +/** + * The ranker to use for the file search. If not specified will use the `auto` ranker. + */ +export const FileSearchRanker = { AUTO: 'auto', DEFAULT_2024_08_21: 'default_2024_08_21' } as const; + +/** + * The ranker to use for the file search. If not specified will use the `auto` ranker. + */ +export type FileSearchRanker = (typeof FileSearchRanker)[keyof typeof FileSearchRanker]; + +/** + * File search tool call ranking options + * + * The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. + * + * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + * + */ +export type FileSearchRankingOptions = { + ranker?: FileSearchRanker; + /** + * The score threshold for the file search. All values must be a floating point number between 0 and 1. + */ + score_threshold: number; +}; + +/** + * File search tool call + * + * The results of a file search tool call. See the + * [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. + * + */ +export type FileSearchToolCall = { + /** + * The unique ID of the file search tool call. + * + */ + id: string; + /** + * The type of the file search tool call. Always `file_search_call`. + * + */ + type: 'file_search_call'; + /** + * The status of the file search tool call. One of `in_progress`, + * `searching`, `incomplete` or `failed`, + * + */ + status: 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed'; + /** + * The queries used to search for files. + * + */ + queries: Array; + /** + * The results of the file search tool call. + * + */ + results?: Array<{ + /** + * The unique ID of the file. * */ - output_format?: 'png' | 'jpeg' | 'webp'; + file_id?: string; /** - * The compression level (0-100%) for the generated images. This parameter - * is only supported for `gpt-image-1` with the `webp` or `jpeg` output - * formats, and defaults to 100. + * The text that was retrieved from the file. * */ - output_compression?: number; + text?: string; /** - * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * The name of the file. * */ - user?: string; - input_fidelity?: ImageInputFidelity; + filename?: string; + attributes?: VectorStoreFileAttributes; /** - * Edit the image in streaming mode. Defaults to `false`. See the - * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. + * The relevance score of the file - a value between 0 and 1. * */ - stream?: boolean; - partial_images?: PartialImages; + score?: number; + }>; +}; + +export type FineTuneChatCompletionRequestAssistantMessage = { + /** + * Controls whether the assistant message is trained against (0 or 1) + */ + weight?: 0 | 1; +} & ChatCompletionRequestAssistantMessage; + +/** + * The per-line training example of a fine-tuning input file for chat models using the supervised method. + * Input messages may contain text or image content only. Audio and file input messages + * are not currently supported for fine-tuning. + * + */ +export type FineTuneChatRequestInput = { + messages?: Array< + | ChatCompletionRequestSystemMessage + | ChatCompletionRequestUserMessage + | FineTuneChatCompletionRequestAssistantMessage + | ChatCompletionRequestToolMessage + | ChatCompletionRequestFunctionMessage + >; + /** + * A list of tools the model may generate JSON inputs for. + */ + tools?: Array; + parallel_tool_calls?: ParallelToolCalls; + /** + * A list of functions the model may generate JSON inputs for. + * + * @deprecated + */ + functions?: Array; +}; + +/** + * The hyperparameters used for the DPO fine-tuning job. + */ +export type FineTuneDpoHyperparameters = { + /** + * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. + * + */ + beta?: 'auto' | number; + /** + * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + * + */ + batch_size?: 'auto' | number; + /** + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + * + */ + learning_rate_multiplier?: 'auto' | number; + /** + * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + * + */ + n_epochs?: 'auto' | number; +}; + +/** + * Configuration for the DPO fine-tuning method. + */ +export type FineTuneDpoMethod = { + hyperparameters?: FineTuneDpoHyperparameters; +}; + +/** + * The method used for fine-tuning. + */ +export type FineTuneMethod = { + /** + * The type of method. Is either `supervised`, `dpo`, or `reinforcement`. + */ + type: 'supervised' | 'dpo' | 'reinforcement'; + supervised?: FineTuneSupervisedMethod; + dpo?: FineTuneDpoMethod; + reinforcement?: FineTuneReinforcementMethod; +}; + +/** + * The per-line training example of a fine-tuning input file for chat models using the dpo method. + * Input messages may contain text or image content only. Audio and file input messages + * are not currently supported for fine-tuning. + * + */ +export type FineTunePreferenceRequestInput = { + input?: { + messages?: Array< + | ChatCompletionRequestSystemMessage + | ChatCompletionRequestUserMessage + | FineTuneChatCompletionRequestAssistantMessage + | ChatCompletionRequestToolMessage + | ChatCompletionRequestFunctionMessage + >; /** - * The quality of the image that will be generated. `high`, `medium` and `low` are only supported for `gpt-image-1`. `dall-e-2` only supports `standard` quality. Defaults to `auto`. - * + * A list of tools the model may generate JSON inputs for. */ - quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto'; + tools?: Array; + parallel_tool_calls?: ParallelToolCalls; + }; + /** + * The preferred completion message for the output. + */ + preferred_output?: Array; + /** + * The non-preferred completion message for the output. + */ + non_preferred_output?: Array; }; -export type CreateImageRequest = { +/** + * The hyperparameters used for the reinforcement fine-tuning job. + */ +export type FineTuneReinforcementHyperparameters = { + /** + * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + * + */ + batch_size?: 'auto' | number; + /** + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + * + */ + learning_rate_multiplier?: 'auto' | number; + /** + * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + * + */ + n_epochs?: 'auto' | number; + /** + * Level of reasoning effort. + * + */ + reasoning_effort?: 'default' | 'low' | 'medium' | 'high'; + /** + * Multiplier on amount of compute used for exploring search space during training. + * + */ + compute_multiplier?: 'auto' | number; + /** + * The number of training steps between evaluation runs. + * + */ + eval_interval?: 'auto' | number; + /** + * Number of evaluation samples to generate per training step. + * + */ + eval_samples?: 'auto' | number; +}; + +/** + * Configuration for the reinforcement fine-tuning method. + */ +export type FineTuneReinforcementMethod = { + /** + * The grader used for the fine-tuning job. + */ + grader: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderMulti; + hyperparameters?: FineTuneReinforcementHyperparameters; +}; + +/** + * Per-line training example for reinforcement fine-tuning. Note that `messages` and `tools` are the only reserved keywords. + * Any other arbitrary key-value data can be included on training datapoints and will be available to reference during grading under the `{{ item.XXX }}` template variable. + * Input messages may contain text or image content only. Audio and file input messages + * are not currently supported for fine-tuning. + * + */ +export type FineTuneReinforcementRequestInput = { + messages: Array< + | ChatCompletionRequestDeveloperMessage + | ChatCompletionRequestUserMessage + | FineTuneChatCompletionRequestAssistantMessage + | ChatCompletionRequestToolMessage + >; + /** + * A list of tools the model may generate JSON inputs for. + */ + tools?: Array; +}; + +/** + * The hyperparameters used for the fine-tuning job. + */ +export type FineTuneSupervisedHyperparameters = { + /** + * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + * + */ + batch_size?: 'auto' | number; + /** + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + * + */ + learning_rate_multiplier?: 'auto' | number; + /** + * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + * + */ + n_epochs?: 'auto' | number; +}; + +/** + * Configuration for the supervised fine-tuning method. + */ +export type FineTuneSupervisedMethod = { + hyperparameters?: FineTuneSupervisedHyperparameters; +}; + +/** + * FineTuningCheckpointPermission + * + * The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint. + * + */ +export type FineTuningCheckpointPermission = { + /** + * The permission identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the permission was created. + */ + created_at: number; + /** + * The project identifier that the permission is for. + */ + project_id: string; + /** + * The object type, which is always "checkpoint.permission". + */ + object: 'checkpoint.permission'; +}; + +/** + * Fine-Tuning Job Integration + */ +export type FineTuningIntegration = { + /** + * The type of the integration being enabled for the fine-tuning job + */ + type: 'wandb'; + /** + * The settings for your integration with Weights and Biases. This payload specifies the project that + * metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags + * to your run, and set a default entity (team, username, etc) to be associated with your run. + * + */ + wandb: { /** - * A text description of the desired image(s). The maximum length is 32000 characters for `gpt-image-1`, 1000 characters for `dall-e-2` and 4000 characters for `dall-e-3`. + * The name of the project that the new run will be created under. + * */ - prompt: string; + project: string; /** - * The model to use for image generation. One of `dall-e-2`, `dall-e-3`, or `gpt-image-1`. Defaults to `dall-e-2` unless a parameter specific to `gpt-image-1` is used. + * A display name to set for the run. If not set, we will use the Job ID as the name. + * */ - model?: string | 'dall-e-2' | 'dall-e-3' | 'gpt-image-1'; + name?: string; /** - * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. + * The entity to use for the run. This allows you to set the team or username of the WandB user that you would + * like associated with the run. If not set, the default entity for the registered WandB API key is used. + * */ - n?: number; + entity?: string; /** - * The quality of the image that will be generated. - * - * - `auto` (default value) will automatically select the best quality for the given model. - * - `high`, `medium` and `low` are supported for `gpt-image-1`. - * - `hd` and `standard` are supported for `dall-e-3`. - * - `standard` is the only option for `dall-e-2`. + * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some + * default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". * */ - quality?: 'standard' | 'hd' | 'low' | 'medium' | 'high' | 'auto'; - /** - * The format in which generated images with `dall-e-2` and `dall-e-3` are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. This parameter isn't supported for `gpt-image-1` which will always return base64-encoded images. + tags?: Array; + }; +}; + +/** + * FineTuningJob + * + * The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. + * + */ +export type FineTuningJob = { + /** + * The object identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the fine-tuning job was created. + */ + created_at: number; + /** + * For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. + */ + error: { + /** + * A machine-readable error code. */ - response_format?: 'url' | 'b64_json'; + code: string; /** - * The format in which the generated images are returned. This parameter is only supported for `gpt-image-1`. Must be one of `png`, `jpeg`, or `webp`. + * A human-readable error message. */ - output_format?: 'png' | 'jpeg' | 'webp'; + message: string; /** - * The compression level (0-100%) for the generated images. This parameter is only supported for `gpt-image-1` with the `webp` or `jpeg` output formats, and defaults to 100. + * The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. */ - output_compression?: number; - /** - * Generate the image in streaming mode. Defaults to `false`. See the - * [Image generation guide](https://platform.openai.com/docs/guides/image-generation) for more information. - * This parameter is only supported for `gpt-image-1`. + param: string; + }; + /** + * The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. + */ + fine_tuned_model: string; + /** + * The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. + */ + finished_at: number; + /** + * The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs. + */ + hyperparameters: { + /** + * Number of examples in each batch. A larger batch size means that model parameters + * are updated less frequently, but with lower variance. * */ - stream?: boolean; - partial_images?: PartialImages; - /** - * The size of the generated images. Must be one of `1024x1024`, `1536x1024` (landscape), `1024x1536` (portrait), or `auto` (default value) for `gpt-image-1`, one of `256x256`, `512x512`, or `1024x1024` for `dall-e-2`, and one of `1024x1024`, `1792x1024`, or `1024x1792` for `dall-e-3`. - */ - size?: 'auto' | '1024x1024' | '1536x1024' | '1024x1536' | '256x256' | '512x512' | '1792x1024' | '1024x1792'; - /** - * Control the content-moderation level for images generated by `gpt-image-1`. Must be either `low` for less restrictive filtering or `auto` (default value). - */ - moderation?: 'low' | 'auto'; + batch_size?: 'auto' | number; /** - * Allows to set transparency for the background of the generated image(s). - * This parameter is only supported for `gpt-image-1`. Must be one of - * `transparent`, `opaque` or `auto` (default value). When `auto` is used, the - * model will automatically determine the best background for the image. + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid + * overfitting. * - * If `transparent`, the output format needs to support transparency, so it - * should be set to either `png` (default value) or `webp`. - * - */ - background?: 'transparent' | 'opaque' | 'auto'; - /** - * The style of the generated images. This parameter is only supported for `dall-e-3`. Must be one of `vivid` or `natural`. Vivid causes the model to lean towards generating hyper-real and dramatic images. Natural causes the model to produce more natural, less hyper-real looking images. */ - style?: 'vivid' | 'natural'; + learning_rate_multiplier?: 'auto' | number; /** - * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). + * The number of epochs to train the model for. An epoch refers to one full cycle + * through the training dataset. * */ - user?: string; -}; - -export type CreateImageVariationRequest = { - /** - * The image to use as the basis for the variation(s). Must be a valid PNG file, less than 4MB, and square. - */ - image: Blob | File; - /** - * The model to use for image generation. Only `dall-e-2` is supported at this time. - */ - model?: string | 'dall-e-2'; - /** - * The number of images to generate. Must be between 1 and 10. - */ - n?: number; - /** - * The format in which the generated images are returned. Must be one of `url` or `b64_json`. URLs are only valid for 60 minutes after the image has been generated. - */ - response_format?: 'url' | 'b64_json'; - /** - * The size of the generated images. Must be one of `256x256`, `512x512`, or `1024x1024`. - */ - size?: '256x256' | '512x512' | '1024x1024'; - /** - * A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#end-user-ids). - * - */ - user?: string; -}; - -export type CreateMessageRequest = { - /** - * The role of the entity that is creating the message. Allowed values include: - * - `user`: Indicates the message is sent by an actual user and should be used in most cases to represent user-generated messages. - * - `assistant`: Indicates the message is generated by the assistant. Use this value to insert messages from the assistant into the conversation. - * - */ - role: 'user' | 'assistant'; - content: string | Array<({ - type?: 'MessageContentImageFileObject'; - } & MessageContentImageFileObject) | ({ - type?: 'MessageContentImageUrlObject'; - } & MessageContentImageUrlObject) | ({ - type?: 'MessageRequestContentTextObject'; - } & MessageRequestContentTextObject)>; - /** - * A list of files attached to the message, and the tools they should be added to. - */ - attachments?: Array<{ - /** - * The ID of the file to attach to the message. - */ - file_id?: string; - /** - * The tools to add this file to. - */ - tools?: Array<({ - type?: 'AssistantToolsCode'; - } & AssistantToolsCode) | ({ - type?: 'AssistantToolsFileSearchTypeOnly'; - } & AssistantToolsFileSearchTypeOnly)>; - }>; - metadata?: Metadata; -}; - -export type CreateModelResponseProperties = ModelResponseProperties & { - /** - * An integer between 0 and 20 specifying the number of most likely tokens to - * return at each token position, each with an associated log probability. - * - */ - top_logprobs?: number; -}; - -export type CreateModerationRequest = { - /** - * Input (or inputs) to classify. Can be a single string, an array of strings, or - * an array of multi-modal input objects similar to other models. - * - */ - input: string | Array | Array<({ - type?: 'ModerationImageURLInput'; - } & ModerationImageUrlInput) | ({ - type?: 'ModerationTextInput'; - } & ModerationTextInput)>; - /** - * The content moderation model you would like to use. Learn more in - * [the moderation guide](https://platform.openai.com/docs/guides/moderation), and learn about - * available models [here](https://platform.openai.com/docs/models#moderation). - * - */ - model?: string | 'omni-moderation-latest' | 'omni-moderation-2024-09-26' | 'text-moderation-latest' | 'text-moderation-stable'; -}; - -/** - * Represents if a given text input is potentially harmful. - */ -export type CreateModerationResponse = { - /** - * The unique identifier for the moderation request. - */ - id: string; - /** - * The model used to generate the moderation results. - */ - model: string; - /** - * A list of moderation objects. - */ - results: Array<{ - /** - * Whether any of the below categories are flagged. - */ - flagged: boolean; - /** - * A list of the categories, and whether they are flagged or not. - */ - categories: { - /** - * Content that expresses, incites, or promotes hate based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. Hateful content aimed at non-protected groups (e.g., chess players) is harassment. - */ - hate: boolean; - /** - * Hateful content that also includes violence or serious harm towards the targeted group based on race, gender, ethnicity, religion, nationality, sexual orientation, disability status, or caste. - */ - 'hate/threatening': boolean; - /** - * Content that expresses, incites, or promotes harassing language towards any target. - */ - harassment: boolean; - /** - * Harassment content that also includes violence or serious harm towards any target. - */ - 'harassment/threatening': boolean; - /** - * Content that includes instructions or advice that facilitate the planning or execution of wrongdoing, or that gives advice or instruction on how to commit illicit acts. For example, "how to shoplift" would fit this category. - */ - illicit: boolean; - /** - * Content that includes instructions or advice that facilitate the planning or execution of wrongdoing that also includes violence, or that gives advice or instruction on the procurement of any weapon. - */ - 'illicit/violent': boolean; - /** - * Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. - */ - 'self-harm': boolean; - /** - * Content where the speaker expresses that they are engaging or intend to engage in acts of self-harm, such as suicide, cutting, and eating disorders. - */ - 'self-harm/intent': boolean; - /** - * Content that encourages performing acts of self-harm, such as suicide, cutting, and eating disorders, or that gives instructions or advice on how to commit such acts. - */ - 'self-harm/instructions': boolean; - /** - * Content meant to arouse sexual excitement, such as the description of sexual activity, or that promotes sexual services (excluding sex education and wellness). - */ - sexual: boolean; - /** - * Sexual content that includes an individual who is under 18 years old. - */ - 'sexual/minors': boolean; - /** - * Content that depicts death, violence, or physical injury. - */ - violence: boolean; - /** - * Content that depicts death, violence, or physical injury in graphic detail. - */ - 'violence/graphic': boolean; - }; - /** - * A list of the categories along with their scores as predicted by model. - */ - category_scores: { - /** - * The score for the category 'hate'. - */ - hate: number; - /** - * The score for the category 'hate/threatening'. - */ - 'hate/threatening': number; - /** - * The score for the category 'harassment'. - */ - harassment: number; - /** - * The score for the category 'harassment/threatening'. - */ - 'harassment/threatening': number; - /** - * The score for the category 'illicit'. - */ - illicit: number; - /** - * The score for the category 'illicit/violent'. - */ - 'illicit/violent': number; - /** - * The score for the category 'self-harm'. - */ - 'self-harm': number; - /** - * The score for the category 'self-harm/intent'. - */ - 'self-harm/intent': number; - /** - * The score for the category 'self-harm/instructions'. - */ - 'self-harm/instructions': number; - /** - * The score for the category 'sexual'. - */ - sexual: number; - /** - * The score for the category 'sexual/minors'. - */ - 'sexual/minors': number; - /** - * The score for the category 'violence'. - */ - violence: number; - /** - * The score for the category 'violence/graphic'. - */ - 'violence/graphic': number; - }; - /** - * A list of the categories along with the input type(s) that the score applies to. - */ - category_applied_input_types: { - /** - * The applied input type(s) for the category 'hate'. - */ - hate: Array<'text'>; - /** - * The applied input type(s) for the category 'hate/threatening'. - */ - 'hate/threatening': Array<'text'>; - /** - * The applied input type(s) for the category 'harassment'. - */ - harassment: Array<'text'>; - /** - * The applied input type(s) for the category 'harassment/threatening'. - */ - 'harassment/threatening': Array<'text'>; - /** - * The applied input type(s) for the category 'illicit'. - */ - illicit: Array<'text'>; - /** - * The applied input type(s) for the category 'illicit/violent'. - */ - 'illicit/violent': Array<'text'>; - /** - * The applied input type(s) for the category 'self-harm'. - */ - 'self-harm': Array<'text' | 'image'>; - /** - * The applied input type(s) for the category 'self-harm/intent'. - */ - 'self-harm/intent': Array<'text' | 'image'>; - /** - * The applied input type(s) for the category 'self-harm/instructions'. - */ - 'self-harm/instructions': Array<'text' | 'image'>; - /** - * The applied input type(s) for the category 'sexual'. - */ - sexual: Array<'text' | 'image'>; - /** - * The applied input type(s) for the category 'sexual/minors'. - */ - 'sexual/minors': Array<'text'>; - /** - * The applied input type(s) for the category 'violence'. - */ - violence: Array<'text' | 'image'>; - /** - * The applied input type(s) for the category 'violence/graphic'. - */ - 'violence/graphic': Array<'text' | 'image'>; - }; - }>; -}; - -export type CreateResponse = CreateModelResponseProperties & ResponseProperties & { - /** - * Text, image, or file inputs to the model, used to generate a response. - * - * Learn more: - * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - * - [Image inputs](https://platform.openai.com/docs/guides/images) - * - [File inputs](https://platform.openai.com/docs/guides/pdf-files) - * - [Conversation state](https://platform.openai.com/docs/guides/conversation-state) - * - [Function calling](https://platform.openai.com/docs/guides/function-calling) - * - */ - input?: string | Array; - /** - * Specify additional output data to include in the model response. Currently - * supported values are: - * - `code_interpreter_call.outputs`: Includes the outputs of python code execution - * in code interpreter tool call items. - * - `computer_call_output.output.image_url`: Include image urls from the computer call output. - * - `file_search_call.results`: Include the search results of - * the file search tool call. - * - `message.input_image.image_url`: Include image urls from the input message. - * - `message.output_text.logprobs`: Include logprobs with assistant messages. - * - `reasoning.encrypted_content`: Includes an encrypted version of reasoning - * tokens in reasoning item outputs. This enables reasoning items to be used in - * multi-turn conversations when using the Responses API statelessly (like - * when the `store` parameter is set to `false`, or when an organization is - * enrolled in the zero data retention program). - * - */ - include?: Array; - /** - * Whether to allow the model to run tool calls in parallel. - * - */ - parallel_tool_calls?: boolean; - /** - * Whether to store the generated model response for later retrieval via - * API. - * - */ - store?: boolean; - /** - * A system (or developer) message inserted into the model's context. - * - * When using along with `previous_response_id`, the instructions from a previous - * response will not be carried over to the next response. This makes it simple - * to swap out system (or developer) messages in new responses. - * - */ - instructions?: string; - /** - * If set to true, the model response data will be streamed to the client - * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) - * for more information. - * - */ - stream?: boolean; - stream_options?: ResponseStreamOptions; -}; - -export type CreateRunRequest = { - /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - */ - assistant_id: string; - /** - * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - */ - model?: string | AssistantSupportedModels; - reasoning_effort?: ReasoningEffort; - /** - * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - */ - instructions?: string; - /** - * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - */ - additional_instructions?: string; - /** - * Adds additional messages to the thread before creating the run. - */ - additional_messages?: Array; - /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - */ - tools?: Array; - metadata?: Metadata; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * - */ - top_p?: number; - /** - * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - * - */ - stream?: boolean; - /** - * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_prompt_tokens?: number; - /** - * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_completion_tokens?: number; - truncation_strategy?: TruncationObject & unknown; - tool_choice?: AssistantsApiToolChoiceOption & unknown; - parallel_tool_calls?: ParallelToolCalls; - response_format?: AssistantsApiResponseFormatOption; -}; - -export type CreateSpeechRequest = { - /** - * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. - * - */ - model: string | 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts'; - /** - * The text to generate audio for. The maximum length is 4096 characters. - */ - input: string; - /** - * Control the voice of your generated audio with additional instructions. Does not work with `tts-1` or `tts-1-hd`. - */ - instructions?: string; - /** - * 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 [Text to speech guide](https://platform.openai.com/docs/guides/text-to-speech#voice-options). - */ - voice: VoiceIdsShared; - /** - * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. - */ - response_format?: 'mp3' | 'opus' | 'aac' | 'flac' | 'wav' | 'pcm'; - /** - * The speed of the generated audio. Select a value from `0.25` to `4.0`. `1.0` is the default. - */ - speed?: number; - /** - * The format to stream the audio in. Supported formats are `sse` and `audio`. `sse` is not supported for `tts-1` or `tts-1-hd`. - */ - stream_format?: 'sse' | 'audio'; -}; - -export type CreateSpeechResponseStreamEvent = ({ - type?: 'SpeechAudioDeltaEvent'; -} & SpeechAudioDeltaEvent) | ({ - type?: 'SpeechAudioDoneEvent'; -} & SpeechAudioDoneEvent); - -export type CreateThreadAndRunRequest = { - /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - */ - assistant_id: string; - thread?: CreateThreadRequest; - /** - * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - */ - model?: string | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-2025-08-07' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'; - /** - * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - */ - instructions?: string; - /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - */ - tools?: Array; - /** - * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources?: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: { - /** - * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - * - */ - vector_store_ids?: Array; - }; - }; - metadata?: Metadata; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * - */ - top_p?: number; - /** - * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - * - */ - stream?: boolean; - /** - * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_prompt_tokens?: number; - /** - * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_completion_tokens?: number; - truncation_strategy?: TruncationObject & unknown; - tool_choice?: AssistantsApiToolChoiceOption & unknown; - parallel_tool_calls?: ParallelToolCalls; - response_format?: AssistantsApiResponseFormatOption; -}; - -/** - * Options to create a new thread. If no thread is provided when running a - * request, an empty thread will be created. - * - */ -export type CreateThreadRequest = { - /** - * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. - */ - messages?: Array; - /** - * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources?: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: unknown & { - /** - * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - * - */ - vector_store_ids?: Array; - /** - * A helper to create a [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) with file_ids and attach it to this thread. There can be a maximum of 1 vector store attached to the thread. - * - */ - vector_stores?: Array<{ - /** - * 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. - * - */ - file_ids?: Array; - /** - * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. - */ - chunking_strategy?: { - /** - * Always `auto`. - */ - type: 'auto'; - } | { - /** - * Always `static`. - */ - type: 'static'; - static: { - /** - * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - */ - max_chunk_size_tokens: number; - /** - * The number of tokens that overlap between chunks. The default value is `400`. - * - * Note that the overlap must not exceed half of `max_chunk_size_tokens`. - * - */ - chunk_overlap_tokens: number; - }; - }; - metadata?: Metadata; - }>; - }; - }; - metadata?: Metadata; -}; - -export type CreateTranscriptionRequest = { - /** - * The audio file object (not file name) to transcribe, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - * - */ - file: Blob | File; - /** - * ID of the model to use. The options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1` (which is powered by our open source Whisper V2 model). - * - */ - model: string | 'whisper-1' | 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe'; - /** - * The language of the input audio. Supplying the input language in [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format will improve accuracy and latency. - * - */ - language?: string; - /** - * An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match the audio language. - * - */ - prompt?: string; - response_format?: AudioResponseFormat; - /** - * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. - * - */ - temperature?: number; - /** - * If set to true, the model response data will be streamed to the client - * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - * See the [Streaming section of the Speech-to-Text guide](https://platform.openai.com/docs/guides/speech-to-text?lang=curl#streaming-transcriptions) - * for more information. - * - * Note: Streaming is not supported for the `whisper-1` model and will be ignored. - * - */ - stream?: boolean; - chunking_strategy?: TranscriptionChunkingStrategy; - /** - * The timestamp granularities to populate for this transcription. `response_format` must be set `verbose_json` to use timestamp granularities. Either or both of these options are supported: `word`, or `segment`. Note: There is no additional latency for segment timestamps, but generating word timestamps incurs additional latency. - * - */ - timestamp_granularities?: Array<'word' | 'segment'>; - /** - * Additional information to include in the transcription response. - * `logprobs` will return the log probabilities of the tokens in the - * response to understand the model's confidence in the transcription. - * `logprobs` only works with response_format set to `json` and only with - * the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe`. - * - */ - include?: Array; -}; - -/** - * Represents a transcription response returned by model, based on the provided input. - */ -export type CreateTranscriptionResponseJson = { - /** - * The transcribed text. - */ - text: string; - /** - * The log probabilities of the tokens in the transcription. Only returned with the models `gpt-4o-transcribe` and `gpt-4o-mini-transcribe` if `logprobs` is added to the `include` array. - * - */ - logprobs?: Array<{ - /** - * The token in the transcription. - */ - token?: string; - /** - * The log probability of the token. - */ - logprob?: number; - /** - * The bytes of the token. - */ - bytes?: Array; - }>; - /** - * Token usage statistics for the request. - */ - usage?: ({ - type?: 'TranscriptTextUsageTokens'; - } & TranscriptTextUsageTokens) | ({ - type?: 'TranscriptTextUsageDuration'; - } & TranscriptTextUsageDuration); -}; - -export type CreateTranscriptionResponseStreamEvent = ({ - type?: 'TranscriptTextDeltaEvent'; -} & TranscriptTextDeltaEvent) | ({ - type?: 'TranscriptTextDoneEvent'; -} & TranscriptTextDoneEvent); - -/** - * Represents a verbose json transcription response returned by model, based on the provided input. - */ -export type CreateTranscriptionResponseVerboseJson = { - /** - * The language of the input audio. - */ - language: string; - /** - * The duration of the input audio. - */ - duration: number; - /** - * The transcribed text. - */ - text: string; - /** - * Extracted words and their corresponding timestamps. - */ - words?: Array; - /** - * Segments of the transcribed text and their corresponding details. - */ - segments?: Array; - usage?: TranscriptTextUsageDuration; -}; - -export type CreateTranslationRequest = { - /** - * The audio file object (not file name) translate, in one of these formats: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm. - * - */ - file: Blob | File; - /** - * ID of the model to use. Only `whisper-1` (which is powered by our open source Whisper V2 model) is currently available. - * - */ - model: string | 'whisper-1'; - /** - * An optional text to guide the model's style or continue a previous audio segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should be in English. - * - */ - prompt?: string; - /** - * The format of the output, in one of these options: `json`, `text`, `srt`, `verbose_json`, or `vtt`. - * - */ - response_format?: 'json' | 'text' | 'srt' | 'verbose_json' | 'vtt'; - /** - * The sampling temperature, between 0 and 1. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. If set to 0, the model will use [log probability](https://en.wikipedia.org/wiki/Log_probability) to automatically increase the temperature until certain thresholds are hit. - * - */ - temperature?: number; -}; - -export type CreateTranslationResponseJson = { - text: string; -}; - -export type CreateTranslationResponseVerboseJson = { - /** - * The language of the output translation (always `english`). - */ - language: string; - /** - * The duration of the input audio. - */ - duration: number; - /** - * The translated text. - */ - text: string; - /** - * Segments of the translated text and their corresponding details. - */ - segments?: Array; -}; - -export type CreateUploadRequest = { - /** - * The name of the file to upload. - * - */ - filename: string; - /** - * The intended purpose of the uploaded file. - * - * See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). - * - */ - purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision'; - /** - * The number of bytes in the file you are uploading. - * - */ - bytes: number; - /** - * The MIME type of the file. - * - * This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision. - * - */ - mime_type: string; - expires_after?: FileExpirationAfter; -}; - -export type CreateVectorStoreFileBatchRequest = { - /** - * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. - */ - file_ids: Array; - chunking_strategy?: ChunkingStrategyRequestParam; - attributes?: VectorStoreFileAttributes; -}; - -export type CreateVectorStoreFileRequest = { - /** - * A [File](https://platform.openai.com/docs/api-reference/files) ID that the vector store should use. Useful for tools like `file_search` that can access files. - */ - file_id: string; - chunking_strategy?: ChunkingStrategyRequestParam; - attributes?: VectorStoreFileAttributes; -}; - -export type CreateVectorStoreRequest = { - /** - * A list of [File](https://platform.openai.com/docs/api-reference/files) IDs that the vector store should use. Useful for tools like `file_search` that can access files. - */ - file_ids?: Array; - /** - * The name of the vector store. - */ - name?: string; - expires_after?: VectorStoreExpirationAfter; - chunking_strategy?: ChunkingStrategyRequestParam; - metadata?: Metadata; -}; - -/** - * Custom tool - * - * A custom tool that processes input using a specified format. Learn more about - * [custom tools](https://platform.openai.com/docs/guides/function-calling#custom-tools). - * - */ -export type CustomTool = { - /** - * The type of the custom tool. Always `custom`. - */ - type: 'custom'; - /** - * The name of the custom tool, used to identify it in tool calls. - */ - name: string; - /** - * Optional description of the custom tool, used to provide more context. - * - */ - description?: string; - /** - * The input format for the custom tool. Default is unconstrained text. - * - */ - format?: { - /** - * Unconstrained text format. Always `text`. - */ - type: 'text'; - } | { - /** - * Grammar format. Always `grammar`. - */ - type: 'grammar'; - /** - * The grammar definition. - */ - definition: string; - /** - * The syntax of the grammar definition. One of `lark` or `regex`. - */ - syntax: 'lark' | 'regex'; - }; -}; - -/** - * Custom tool call - * - * A call to a custom tool created by the model. - * - */ -export type CustomToolCall = { - /** - * The type of the custom tool call. Always `custom_tool_call`. - * - */ - type: 'custom_tool_call'; - /** - * The unique ID of the custom tool call in the OpenAI platform. - * - */ - id?: string; - /** - * An identifier used to map this custom tool call to a tool call output. - * - */ - call_id: string; - /** - * The name of the custom tool being called. - * - */ - name: string; - /** - * The input for the custom tool call generated by the model. - * - */ - input: string; -}; - -/** - * Custom tool call output - * - * The output of a custom tool call from your code, being sent back to the model. - * - */ -export type CustomToolCallOutput = { - /** - * The type of the custom tool call output. Always `custom_tool_call_output`. - * - */ - type: 'custom_tool_call_output'; - /** - * The unique ID of the custom tool call output in the OpenAI platform. - * - */ - id?: string; - /** - * The call ID, used to map this custom tool call output to a custom tool call. - * - */ - call_id: string; - /** - * The output from the custom tool call generated by your code. - * - */ - output: string; -}; - -/** - * Custom tool - * - * A custom tool that processes input using a specified format. - * - */ -export type CustomToolChatCompletions = { - /** - * The type of the custom tool. Always `custom`. - */ - type: 'custom'; - /** - * Custom tool properties - * - * Properties of the custom tool. - * - */ - custom: { - /** - * The name of the custom tool, used to identify it in tool calls. - */ - name: string; - /** - * Optional description of the custom tool, used to provide more context. - * - */ - description?: string; - /** - * The input format for the custom tool. Default is unconstrained text. - * - */ - format?: { - /** - * Unconstrained text format. Always `text`. - */ - type: 'text'; - } | { - /** - * Grammar format. Always `grammar`. - */ - type: 'grammar'; - /** - * Grammar format - * - * Your chosen grammar. - */ - grammar: { - /** - * The grammar definition. - */ - definition: string; - /** - * The syntax of the grammar definition. One of `lark` or `regex`. - */ - syntax: 'lark' | 'regex'; - }; - }; - }; -}; - -export type DeleteAssistantResponse = { - id: string; - deleted: boolean; - object: 'assistant.deleted'; -}; - -export type DeleteCertificateResponse = { - /** - * The object type, must be `certificate.deleted`. - */ - object: 'certificate.deleted'; - /** - * The ID of the certificate that was deleted. - */ - id: string; -}; - -export type DeleteFileResponse = { - id: string; - object: 'file'; - deleted: boolean; -}; - -export type DeleteFineTuningCheckpointPermissionResponse = { - /** - * The ID of the fine-tuned model checkpoint permission that was deleted. - */ - id: string; - /** - * The object type, which is always "checkpoint.permission". - */ - object: 'checkpoint.permission'; - /** - * Whether the fine-tuned model checkpoint permission was successfully deleted. - */ - deleted: boolean; -}; - -export type DeleteMessageResponse = { - id: string; - deleted: boolean; - object: 'thread.message.deleted'; -}; - -export type DeleteModelResponse = { - id: string; - deleted: boolean; - object: string; -}; - -export type DeleteThreadResponse = { - id: string; - deleted: boolean; - object: 'thread.deleted'; -}; - -export type DeleteVectorStoreFileResponse = { - id: string; - deleted: boolean; - object: 'vector_store.file.deleted'; -}; - -export type DeleteVectorStoreResponse = { - id: string; - deleted: boolean; - object: 'vector_store.deleted'; -}; - -/** - * Occurs when a stream ends. - */ -export type DoneEvent = { - event: 'done'; - data: '[DONE]'; -}; - -/** - * DoubleClick - * - * A double click action. - * - */ -export type DoubleClick = { - /** - * Specifies the event type. For a double click action, this property is - * always set to `double_click`. - * - */ - type: 'double_click'; - /** - * The x-coordinate where the double click occurred. - * - */ - x: number; - /** - * The y-coordinate where the double click occurred. - * - */ - y: number; -}; - -/** - * Drag - * - * A drag action. - * - */ -export type Drag = { - /** - * Specifies the event type. For a drag action, this property is - * always set to `drag`. - * - */ - type: 'drag'; - /** - * An array of coordinates representing the path of the drag action. Coordinates will appear as an array - * of objects, eg - * ``` - * [ - * { x: 100, y: 200 }, - * { x: 200, y: 300 } - * ] - * ``` - * - */ - path: Array; -}; - -/** - * Input message - * - * A message input to the model with a role indicating instruction following - * hierarchy. Instructions given with the `developer` or `system` role take - * precedence over instructions given with the `user` role. Messages with the - * `assistant` role are presumed to have been generated by the model in previous - * interactions. - * - */ -export type EasyInputMessage = { - /** - * The role of the message input. One of `user`, `assistant`, `system`, or - * `developer`. - * - */ - role: 'user' | 'assistant' | 'system' | 'developer'; - /** - * Text, image, or audio input to the model, used to generate a response. - * Can also contain previous assistant responses. - * - */ - content: string | InputMessageContentList; - /** - * The type of the message input. Always `message`. - * - */ - type?: 'message'; -}; - -/** - * Represents an embedding vector returned by embedding endpoint. - * - */ -export type Embedding = { - /** - * The index of the embedding in the list of embeddings. - */ - index: number; - /** - * The embedding vector, which is a list of floats. The length of vector depends on the model as listed in the [embedding guide](https://platform.openai.com/docs/guides/embeddings). - * - */ - embedding: Array; - /** - * The object type, which is always "embedding". - */ - object: 'embedding'; -}; - -export type Error = { - code: string; - message: string; - param: string; - type: string; -}; - -/** - * Occurs when an [error](https://platform.openai.com/docs/guides/error-codes#api-errors) occurs. This can happen due to an internal server error or a timeout. - */ -export type ErrorEvent = { - event: 'error'; - data: Error; -}; - -export type ErrorResponse = { - error: Error; -}; - -/** - * Eval - * - * An Eval object with a data source config and testing criteria. - * An Eval represents a task to be done for your LLM integration. - * Like: - * - Improve the quality of my chatbot - * - See how well my chatbot handles customer support - * - Check if o4-mini is better at my usecase than gpt-4o - * - */ -export type Eval = { - /** - * The object type. - */ - object: 'eval'; - /** - * Unique identifier for the evaluation. - */ - id: string; - /** - * The name of the evaluation. - */ - name: string; - /** - * Configuration of data sources used in runs of the evaluation. - */ - data_source_config: ({ - type?: 'EvalCustomDataSourceConfig'; - } & EvalCustomDataSourceConfig) | ({ - type?: 'EvalLogsDataSourceConfig'; - } & EvalLogsDataSourceConfig) | ({ - type?: 'EvalStoredCompletionsDataSourceConfig'; - } & EvalStoredCompletionsDataSourceConfig); - /** - * A list of testing criteria. - */ - testing_criteria: Array; - /** - * The Unix timestamp (in seconds) for when the eval was created. - */ - created_at: number; - metadata: Metadata; -}; - -/** - * EvalApiError - * - * An object representing an error response from the Eval API. - * - */ -export type EvalApiError = { - /** - * The error code. - */ - code: string; - /** - * The error message. - */ - message: string; -}; - -/** - * CustomDataSourceConfig - * - * A CustomDataSourceConfig which specifies the schema of your `item` and optionally `sample` namespaces. - * The response schema defines the shape of the data that will be: - * - Used to define your testing criteria and - * - What data is required when creating a run - * - */ -export type EvalCustomDataSourceConfig = { - /** - * The type of data source. Always `custom`. - */ - type: 'custom'; - /** - * The json schema for the run data source items. - * Learn how to build JSON schemas [here](https://json-schema.org/). - * - */ - schema: { - [key: string]: unknown; - }; -}; - -/** - * LabelModelGrader - */ -export type EvalGraderLabelModel = GraderLabelModel; - -/** - * PythonGrader - */ -export type EvalGraderPython = GraderPython & { - /** - * The threshold for the score. - */ - pass_threshold?: number; -}; - -/** - * ScoreModelGrader - */ -export type EvalGraderScoreModel = GraderScoreModel & { - /** - * The threshold for the score. - */ - pass_threshold?: number; -}; - -/** - * StringCheckGrader - */ -export type EvalGraderStringCheck = GraderStringCheck; - -/** - * TextSimilarityGrader - */ -export type EvalGraderTextSimilarity = GraderTextSimilarity & { - /** - * The threshold for the score. - */ - pass_threshold: number; -}; - -/** - * Eval message object - * - * A message input to the model with a role indicating instruction following - * hierarchy. Instructions given with the `developer` or `system` role take - * precedence over instructions given with the `user` role. Messages with the - * `assistant` role are presumed to have been generated by the model in previous - * interactions. - * - */ -export type EvalItem = { - /** - * The role of the message input. One of `user`, `assistant`, `system`, or - * `developer`. - * - */ - role: 'user' | 'assistant' | 'system' | 'developer'; - /** - * Inputs to the model - can contain template strings. - * - */ - content: string | InputTextContent | { - /** - * The type of the output text. Always `output_text`. - * - */ - type: 'output_text'; - /** - * The text output from the model. - * - */ - text: string; - } | { - /** - * The type of the image input. Always `input_image`. - * - */ - type: 'input_image'; - /** - * The URL of the image input. - * - */ - image_url: string; - /** - * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - * - */ - detail?: string; - } | Array; - /** - * The type of the message input. Always `message`. - * - */ - type?: 'message'; -}; - -/** - * EvalJsonlFileContentSource - */ -export type EvalJsonlFileContentSource = { - /** - * The type of jsonl source. Always `file_content`. - */ - type: 'file_content'; - /** - * The content of the jsonl file. - */ - content: Array<{ - item: { - [key: string]: unknown; - }; - sample?: { - [key: string]: unknown; - }; - }>; -}; - -/** - * EvalJsonlFileIdSource - */ -export type EvalJsonlFileIdSource = { - /** - * The type of jsonl source. Always `file_id`. - */ - type: 'file_id'; - /** - * The identifier of the file. - */ - id: string; -}; - -/** - * EvalList - * - * An object representing a list of evals. - * - */ -export type EvalList = { - /** - * The type of this object. It is always set to "list". - * - */ - object: 'list'; - /** - * An array of eval objects. - * - */ - data: Array; - /** - * The identifier of the first eval in the data array. - */ - first_id: string; - /** - * The identifier of the last eval in the data array. - */ - last_id: string; - /** - * Indicates whether there are more evals available. - */ - has_more: boolean; -}; - -/** - * LogsDataSourceConfig - * - * A LogsDataSourceConfig which specifies the metadata property of your logs query. - * This is usually metadata like `usecase=chatbot` or `prompt-version=v2`, etc. - * The schema returned by this data source config is used to defined what variables are available in your evals. - * `item` and `sample` are both defined when using this data source config. - * - */ -export type EvalLogsDataSourceConfig = { - /** - * The type of data source. Always `logs`. - */ - type: 'logs'; - metadata?: Metadata; - /** - * The json schema for the run data source items. - * Learn how to build JSON schemas [here](https://json-schema.org/). - * - */ - schema: { - [key: string]: unknown; - }; -}; - -/** - * EvalResponsesSource - * - * A EvalResponsesSource object describing a run data source configuration. - * - */ -export type EvalResponsesSource = { - /** - * The type of run data source. Always `responses`. - */ - type: 'responses'; - /** - * Metadata filter for the responses. This is a query parameter used to select responses. - */ - metadata?: { - [key: string]: unknown; - }; - /** - * The name of the model to find responses for. This is a query parameter used to select responses. - */ - model?: string; - /** - * Optional string to search the 'instructions' field. This is a query parameter used to select responses. - */ - instructions_search?: string; - /** - * Only include items created after this timestamp (inclusive). This is a query parameter used to select responses. - */ - created_after?: number; - /** - * Only include items created before this timestamp (inclusive). This is a query parameter used to select responses. - */ - created_before?: number; - /** - * Optional reasoning effort parameter. This is a query parameter used to select responses. - */ - reasoning_effort?: ReasoningEffort; - /** - * Sampling temperature. This is a query parameter used to select responses. - */ - temperature?: number; - /** - * Nucleus sampling parameter. This is a query parameter used to select responses. - */ - top_p?: number; - /** - * List of user identifiers. This is a query parameter used to select responses. - */ - users?: Array; - /** - * List of tool names. This is a query parameter used to select responses. - */ - tools?: Array; -}; - -/** - * EvalRun - * - * A schema representing an evaluation run. - * - */ -export type EvalRun = { - /** - * The type of the object. Always "eval.run". - */ - object: 'eval.run'; - /** - * Unique identifier for the evaluation run. - */ - id: string; - /** - * The identifier of the associated evaluation. - */ - eval_id: string; - /** - * The status of the evaluation run. - */ - status: string; - /** - * The model that is evaluated, if applicable. - */ - model: string; - /** - * The name of the evaluation run. - */ - name: string; - /** - * Unix timestamp (in seconds) when the evaluation run was created. - */ - created_at: number; - /** - * The URL to the rendered evaluation run report on the UI dashboard. - */ - report_url: string; - /** - * Counters summarizing the outcomes of the evaluation run. - */ - result_counts: { - /** - * Total number of executed output items. - */ - total: number; - /** - * Number of output items that resulted in an error. - */ - errored: number; - /** - * Number of output items that failed to pass the evaluation. - */ - failed: number; - /** - * Number of output items that passed the evaluation. - */ - passed: number; - }; - /** - * Usage statistics for each model during the evaluation run. - */ - per_model_usage: Array<{ - /** - * The name of the model. - */ - model_name: string; - /** - * The number of invocations. - */ - invocation_count: number; - /** - * The number of prompt tokens used. - */ - prompt_tokens: number; - /** - * The number of completion tokens generated. - */ - completion_tokens: number; - /** - * The total number of tokens used. - */ - total_tokens: number; - /** - * The number of tokens retrieved from cache. - */ - cached_tokens: number; - }>; - /** - * Results per testing criteria applied during the evaluation run. - */ - per_testing_criteria_results: Array<{ - /** - * A description of the testing criteria. - */ - testing_criteria: string; - /** - * Number of tests passed for this criteria. - */ - passed: number; - /** - * Number of tests failed for this criteria. - */ - failed: number; - }>; - /** - * Information about the run's data source. - */ - data_source: ({ - type?: 'CreateEvalJsonlRunDataSource'; - } & CreateEvalJsonlRunDataSource) | ({ - type?: 'CreateEvalCompletionsRunDataSource'; - } & CreateEvalCompletionsRunDataSource) | ({ - type?: 'CreateEvalResponsesRunDataSource'; - } & CreateEvalResponsesRunDataSource); - metadata: Metadata; - error: EvalApiError; -}; - -/** - * EvalRunList - * - * An object representing a list of runs for an evaluation. - * - */ -export type EvalRunList = { - /** - * The type of this object. It is always set to "list". - * - */ - object: 'list'; - /** - * An array of eval run objects. - * - */ - data: Array; - /** - * The identifier of the first eval run in the data array. - */ - first_id: string; - /** - * The identifier of the last eval run in the data array. - */ - last_id: string; - /** - * Indicates whether there are more evals available. - */ - has_more: boolean; -}; - -/** - * EvalRunOutputItem - * - * A schema representing an evaluation run output item. - * - */ -export type EvalRunOutputItem = { - /** - * The type of the object. Always "eval.run.output_item". - */ - object: 'eval.run.output_item'; - /** - * Unique identifier for the evaluation run output item. - */ - id: string; - /** - * The identifier of the evaluation run associated with this output item. - */ - run_id: string; - /** - * The identifier of the evaluation group. - */ - eval_id: string; - /** - * Unix timestamp (in seconds) when the evaluation run was created. - */ - created_at: number; - /** - * The status of the evaluation run. - */ - status: string; - /** - * The identifier for the data source item. - */ - datasource_item_id: number; - /** - * Details of the input data source item. - */ - datasource_item: { - [key: string]: unknown; - }; - /** - * A list of results from the evaluation run. - */ - results: Array<{ - [key: string]: unknown; - }>; - /** - * A sample containing the input and output of the evaluation run. - */ - sample: { - /** - * An array of input messages. - */ - input: Array<{ - /** - * The role of the message sender (e.g., system, user, developer). - */ - role: string; - /** - * The content of the message. - */ - content: string; - }>; - /** - * An array of output messages. - */ - output: Array<{ - /** - * The role of the message (e.g. "system", "assistant", "user"). - */ - role?: string; - /** - * The content of the message. - */ - content?: string; - }>; - /** - * The reason why the sample generation was finished. - */ - finish_reason: string; - /** - * The model used for generating the sample. - */ - model: string; - /** - * Token usage details for the sample. - */ - usage: { - /** - * The total number of tokens used. - */ - total_tokens: number; - /** - * The number of completion tokens generated. - */ - completion_tokens: number; - /** - * The number of prompt tokens used. - */ - prompt_tokens: number; - /** - * The number of tokens retrieved from cache. - */ - cached_tokens: number; - }; - error: EvalApiError; - /** - * The sampling temperature used. - */ - temperature: number; - /** - * The maximum number of tokens allowed for completion. - */ - max_completion_tokens: number; - /** - * The top_p value used for sampling. - */ - top_p: number; - /** - * The seed used for generating the sample. - */ - seed: number; - }; -}; - -/** - * EvalRunOutputItemList - * - * An object representing a list of output items for an evaluation run. - * - */ -export type EvalRunOutputItemList = { - /** - * The type of this object. It is always set to "list". - * - */ - object: 'list'; - /** - * An array of eval run output item objects. - * - */ - data: Array; - /** - * The identifier of the first eval run output item in the data array. - */ - first_id: string; - /** - * The identifier of the last eval run output item in the data array. - */ - last_id: string; - /** - * Indicates whether there are more eval run output items available. - */ - has_more: boolean; -}; - -/** - * StoredCompletionsDataSourceConfig - * - * Deprecated in favor of LogsDataSourceConfig. - * - * - * @deprecated - */ -export type EvalStoredCompletionsDataSourceConfig = { - /** - * The type of data source. Always `stored_completions`. - */ - type: 'stored_completions'; - metadata?: Metadata; - /** - * The json schema for the run data source items. - * Learn how to build JSON schemas [here](https://json-schema.org/). - * - */ - schema: { - [key: string]: unknown; - }; -}; - -/** - * StoredCompletionsRunDataSource - * - * A StoredCompletionsRunDataSource configuration describing a set of filters - * - */ -export type EvalStoredCompletionsSource = { - /** - * The type of source. Always `stored_completions`. - */ - type: 'stored_completions'; - metadata?: Metadata; - /** - * An optional model to filter by (e.g., 'gpt-4o'). - */ - model?: string; - /** - * An optional Unix timestamp to filter items created after this time. - */ - created_after?: number; - /** - * An optional Unix timestamp to filter items created before this time. - */ - created_before?: number; - /** - * An optional maximum number of items to return. - */ - limit?: number; -}; - -/** - * File expiration policy - * - * The expiration policy for a file. By default, files with `purpose=batch` expire after 30 days and all other files are persisted until they are manually deleted. - */ -export type FileExpirationAfter = { - /** - * Anchor timestamp after which the expiration policy applies. Supported anchors: `created_at`. - */ - anchor: 'created_at'; - /** - * The number of seconds after the anchor time that the file will expire. Must be between 3600 (1 hour) and 2592000 (30 days). - */ - seconds: number; -}; - -/** - * File path - * - * A path to a file. - * - */ -export type FilePath = { - /** - * The type of the file path. Always `file_path`. - * - */ - type: 'file_path'; - /** - * The ID of the file. - * - */ - file_id: string; - /** - * The index of the file in the list of files. - * - */ - index: number; -}; - -/** - * The ranker to use for the file search. If not specified will use the `auto` ranker. - */ -export const FileSearchRanker = { AUTO: 'auto', DEFAULT_2024_08_21: 'default_2024_08_21' } as const; - -/** - * The ranker to use for the file search. If not specified will use the `auto` ranker. - */ -export type FileSearchRanker = typeof FileSearchRanker[keyof typeof FileSearchRanker]; - -/** - * File search tool call ranking options - * - * The ranking options for the file search. If not specified, the file search tool will use the `auto` ranker and a score_threshold of 0. - * - * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - * - */ -export type FileSearchRankingOptions = { - ranker?: FileSearchRanker; - /** - * The score threshold for the file search. All values must be a floating point number between 0 and 1. - */ - score_threshold: number; -}; - -/** - * File search tool call - * - * The results of a file search tool call. See the - * [file search guide](https://platform.openai.com/docs/guides/tools-file-search) for more information. - * - */ -export type FileSearchToolCall = { - /** - * The unique ID of the file search tool call. - * - */ - id: string; - /** - * The type of the file search tool call. Always `file_search_call`. - * - */ - type: 'file_search_call'; - /** - * The status of the file search tool call. One of `in_progress`, - * `searching`, `incomplete` or `failed`, - * - */ - status: 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed'; - /** - * The queries used to search for files. - * - */ - queries: Array; - /** - * The results of the file search tool call. - * - */ - results?: Array<{ - /** - * The unique ID of the file. - * - */ - file_id?: string; - /** - * The text that was retrieved from the file. - * - */ - text?: string; - /** - * The name of the file. - * - */ - filename?: string; - attributes?: VectorStoreFileAttributes; - /** - * The relevance score of the file - a value between 0 and 1. - * - */ - score?: number; - }>; -}; - -export type FineTuneChatCompletionRequestAssistantMessage = { - /** - * Controls whether the assistant message is trained against (0 or 1) - */ - weight?: 0 | 1; -} & ChatCompletionRequestAssistantMessage; - -/** - * The per-line training example of a fine-tuning input file for chat models using the supervised method. - * Input messages may contain text or image content only. Audio and file input messages - * are not currently supported for fine-tuning. - * - */ -export type FineTuneChatRequestInput = { - messages?: Array; - /** - * A list of tools the model may generate JSON inputs for. - */ - tools?: Array; - parallel_tool_calls?: ParallelToolCalls; - /** - * A list of functions the model may generate JSON inputs for. - * - * @deprecated - */ - functions?: Array; -}; - -/** - * The hyperparameters used for the DPO fine-tuning job. - */ -export type FineTuneDpoHyperparameters = { - /** - * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. - * - */ - beta?: 'auto' | number; - /** - * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. - * - */ - batch_size?: 'auto' | number; - /** - * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. - * - */ - learning_rate_multiplier?: 'auto' | number; - /** - * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - * - */ - n_epochs?: 'auto' | number; -}; - -/** - * Configuration for the DPO fine-tuning method. - */ -export type FineTuneDpoMethod = { - hyperparameters?: FineTuneDpoHyperparameters; -}; - -/** - * The method used for fine-tuning. - */ -export type FineTuneMethod = { - /** - * The type of method. Is either `supervised`, `dpo`, or `reinforcement`. - */ - type: 'supervised' | 'dpo' | 'reinforcement'; - supervised?: FineTuneSupervisedMethod; - dpo?: FineTuneDpoMethod; - reinforcement?: FineTuneReinforcementMethod; -}; - -/** - * The per-line training example of a fine-tuning input file for chat models using the dpo method. - * Input messages may contain text or image content only. Audio and file input messages - * are not currently supported for fine-tuning. - * - */ -export type FineTunePreferenceRequestInput = { - input?: { - messages?: Array; - /** - * A list of tools the model may generate JSON inputs for. - */ - tools?: Array; - parallel_tool_calls?: ParallelToolCalls; - }; - /** - * The preferred completion message for the output. - */ - preferred_output?: Array; - /** - * The non-preferred completion message for the output. - */ - non_preferred_output?: Array; -}; - -/** - * The hyperparameters used for the reinforcement fine-tuning job. - */ -export type FineTuneReinforcementHyperparameters = { - /** - * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. - * - */ - batch_size?: 'auto' | number; - /** - * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. - * - */ - learning_rate_multiplier?: 'auto' | number; - /** - * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - * - */ - n_epochs?: 'auto' | number; - /** - * Level of reasoning effort. - * - */ - reasoning_effort?: 'default' | 'low' | 'medium' | 'high'; - /** - * Multiplier on amount of compute used for exploring search space during training. - * - */ - compute_multiplier?: 'auto' | number; - /** - * The number of training steps between evaluation runs. - * - */ - eval_interval?: 'auto' | number; - /** - * Number of evaluation samples to generate per training step. - * - */ - eval_samples?: 'auto' | number; -}; - -/** - * Configuration for the reinforcement fine-tuning method. - */ -export type FineTuneReinforcementMethod = { - /** - * The grader used for the fine-tuning job. - */ - grader: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderMulti; - hyperparameters?: FineTuneReinforcementHyperparameters; -}; - -/** - * Per-line training example for reinforcement fine-tuning. Note that `messages` and `tools` are the only reserved keywords. - * Any other arbitrary key-value data can be included on training datapoints and will be available to reference during grading under the `{{ item.XXX }}` template variable. - * Input messages may contain text or image content only. Audio and file input messages - * are not currently supported for fine-tuning. - * - */ -export type FineTuneReinforcementRequestInput = { - messages: Array; - /** - * A list of tools the model may generate JSON inputs for. - */ - tools?: Array; -}; - -/** - * The hyperparameters used for the fine-tuning job. - */ -export type FineTuneSupervisedHyperparameters = { - /** - * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. - * - */ - batch_size?: 'auto' | number; - /** - * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. - * - */ - learning_rate_multiplier?: 'auto' | number; - /** - * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. - * - */ - n_epochs?: 'auto' | number; -}; - -/** - * Configuration for the supervised fine-tuning method. - */ -export type FineTuneSupervisedMethod = { - hyperparameters?: FineTuneSupervisedHyperparameters; -}; - -/** - * FineTuningCheckpointPermission - * - * The `checkpoint.permission` object represents a permission for a fine-tuned model checkpoint. - * - */ -export type FineTuningCheckpointPermission = { - /** - * The permission identifier, which can be referenced in the API endpoints. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when the permission was created. - */ - created_at: number; - /** - * The project identifier that the permission is for. - */ - project_id: string; - /** - * The object type, which is always "checkpoint.permission". - */ - object: 'checkpoint.permission'; -}; - -/** - * Fine-Tuning Job Integration - */ -export type FineTuningIntegration = { - /** - * The type of the integration being enabled for the fine-tuning job - */ - type: 'wandb'; - /** - * The settings for your integration with Weights and Biases. This payload specifies the project that - * metrics will be sent to. Optionally, you can set an explicit display name for your run, add tags - * to your run, and set a default entity (team, username, etc) to be associated with your run. - * - */ - wandb: { - /** - * The name of the project that the new run will be created under. - * - */ - project: string; - /** - * A display name to set for the run. If not set, we will use the Job ID as the name. - * - */ - name?: string; - /** - * The entity to use for the run. This allows you to set the team or username of the WandB user that you would - * like associated with the run. If not set, the default entity for the registered WandB API key is used. - * - */ - entity?: string; - /** - * A list of tags to be attached to the newly created run. These tags are passed through directly to WandB. Some - * default tags are generated by OpenAI: "openai/finetune", "openai/{base-model}", "openai/{ftjob-abcdef}". - * - */ - tags?: Array; - }; -}; - -/** - * FineTuningJob - * - * The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. - * - */ -export type FineTuningJob = { - /** - * The object identifier, which can be referenced in the API endpoints. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when the fine-tuning job was created. - */ - created_at: number; - /** - * For fine-tuning jobs that have `failed`, this will contain more information on the cause of the failure. - */ - error: { - /** - * A machine-readable error code. - */ - code: string; - /** - * A human-readable error message. - */ - message: string; - /** - * The parameter that was invalid, usually `training_file` or `validation_file`. This field will be null if the failure was not parameter-specific. - */ - param: string; - }; - /** - * The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. - */ - fine_tuned_model: string; - /** - * The Unix timestamp (in seconds) for when the fine-tuning job was finished. The value will be null if the fine-tuning job is still running. - */ - finished_at: number; - /** - * The hyperparameters used for the fine-tuning job. This value will only be returned when running `supervised` jobs. - */ - hyperparameters: { - /** - * Number of examples in each batch. A larger batch size means that model parameters - * are updated less frequently, but with lower variance. - * - */ - batch_size?: 'auto' | number; - /** - * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid - * overfitting. - * - */ - learning_rate_multiplier?: 'auto' | number; - /** - * The number of epochs to train the model for. An epoch refers to one full cycle - * through the training dataset. - * - */ - n_epochs?: 'auto' | number; - }; - /** - * The base model that is being fine-tuned. - */ - model: string; - /** - * The object type, which is always "fine_tuning.job". - */ - object: 'fine_tuning.job'; - /** - * The organization that owns the fine-tuning job. - */ - organization_id: string; - /** - * The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). - */ - result_files: Array; - /** - * The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. - */ - status: 'validating_files' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled'; - /** - * The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running. - */ - trained_tokens: number; - /** - * The file ID used for training. You can retrieve the training data with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). - */ - training_file: string; - /** - * The file ID used for validation. You can retrieve the validation results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). - */ - validation_file: string; - /** - * A list of integrations to enable for this fine-tuning job. - */ - integrations?: Array<{ - type?: 'FineTuningIntegration'; - } & FineTuningIntegration>; - /** - * The seed used for the fine-tuning job. - */ - seed: number; - /** - * The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running. - */ - estimated_finish?: number; - method?: FineTuneMethod; - metadata?: Metadata; + n_epochs?: 'auto' | number; + }; + /** + * The base model that is being fine-tuned. + */ + model: string; + /** + * The object type, which is always "fine_tuning.job". + */ + object: 'fine_tuning.job'; + /** + * The organization that owns the fine-tuning job. + */ + organization_id: string; + /** + * The compiled results file ID(s) for the fine-tuning job. You can retrieve the results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + */ + result_files: Array; + /** + * The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. + */ + status: 'validating_files' | 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled'; + /** + * The total number of billable tokens processed by this fine-tuning job. The value will be null if the fine-tuning job is still running. + */ + trained_tokens: number; + /** + * The file ID used for training. You can retrieve the training data with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + */ + training_file: string; + /** + * The file ID used for validation. You can retrieve the validation results with the [Files API](https://platform.openai.com/docs/api-reference/files/retrieve-contents). + */ + validation_file: string; + /** + * A list of integrations to enable for this fine-tuning job. + */ + integrations?: Array< + { + type?: 'FineTuningIntegration'; + } & FineTuningIntegration + >; + /** + * The seed used for the fine-tuning job. + */ + seed: number; + /** + * The Unix timestamp (in seconds) for when the fine-tuning job is estimated to finish. The value will be null if the fine-tuning job is not running. + */ + estimated_finish?: number; + method?: FineTuneMethod; + metadata?: Metadata; }; /** @@ -6379,94 +6609,94 @@ export type FineTuningJob = { * */ export type FineTuningJobCheckpoint = { - /** - * The checkpoint identifier, which can be referenced in the API endpoints. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when the checkpoint was created. - */ - created_at: number; - /** - * The name of the fine-tuned checkpoint model that is created. - */ - fine_tuned_model_checkpoint: string; - /** - * The step number that the checkpoint was created at. - */ - step_number: number; - /** - * Metrics at the step number during the fine-tuning job. - */ - metrics: { - step?: number; - train_loss?: number; - train_mean_token_accuracy?: number; - valid_loss?: number; - valid_mean_token_accuracy?: number; - full_valid_loss?: number; - full_valid_mean_token_accuracy?: number; - }; - /** - * The name of the fine-tuning job that this checkpoint was created from. - */ - fine_tuning_job_id: string; - /** - * The object type, which is always "fine_tuning.job.checkpoint". - */ - object: 'fine_tuning.job.checkpoint'; + /** + * The checkpoint identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the checkpoint was created. + */ + created_at: number; + /** + * The name of the fine-tuned checkpoint model that is created. + */ + fine_tuned_model_checkpoint: string; + /** + * The step number that the checkpoint was created at. + */ + step_number: number; + /** + * Metrics at the step number during the fine-tuning job. + */ + metrics: { + step?: number; + train_loss?: number; + train_mean_token_accuracy?: number; + valid_loss?: number; + valid_mean_token_accuracy?: number; + full_valid_loss?: number; + full_valid_mean_token_accuracy?: number; + }; + /** + * The name of the fine-tuning job that this checkpoint was created from. + */ + fine_tuning_job_id: string; + /** + * The object type, which is always "fine_tuning.job.checkpoint". + */ + object: 'fine_tuning.job.checkpoint'; }; /** * Fine-tuning job event object */ export type FineTuningJobEvent = { - /** - * The object type, which is always "fine_tuning.job.event". - */ - object: 'fine_tuning.job.event'; - /** - * The object identifier. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when the fine-tuning job was created. - */ - created_at: number; - /** - * The log level of the event. - */ - level: 'info' | 'warn' | 'error'; - /** - * The message of the event. - */ - message: string; - /** - * The type of event. - */ - type?: 'message' | 'metrics'; - /** - * The data associated with the event. - */ - data?: { - [key: string]: unknown; - }; + /** + * The object type, which is always "fine_tuning.job.event". + */ + object: 'fine_tuning.job.event'; + /** + * The object identifier. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the fine-tuning job was created. + */ + created_at: number; + /** + * The log level of the event. + */ + level: 'info' | 'warn' | 'error'; + /** + * The message of the event. + */ + message: string; + /** + * The type of event. + */ + type?: 'message' | 'metrics'; + /** + * The data associated with the event. + */ + data?: { + [key: string]: unknown; + }; }; export type FunctionObject = { - /** - * A description of what the function does, used by the model to choose when and how to call the function. - */ - description?: string; - /** - * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. - */ - name: string; - parameters?: FunctionParameters; - /** - * Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). - */ - strict?: boolean; + /** + * A description of what the function does, used by the model to choose when and how to call the function. + */ + description?: string; + /** + * The name of the function to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64. + */ + name: string; + parameters?: FunctionParameters; + /** + * Whether to enable strict schema adherence when generating the function call. If set to true, the model will follow the exact schema defined in the `parameters` field. Only a subset of JSON Schema is supported when `strict` is `true`. Learn more about Structured Outputs in the [function calling guide](https://platform.openai.com/docs/guides/function-calling). + */ + strict?: boolean; }; /** @@ -6475,7 +6705,7 @@ export type FunctionObject = { * Omitting `parameters` defines a function with an empty parameter list. */ export type FunctionParameters = { - [key: string]: unknown; + [key: string]: unknown; }; /** @@ -6486,37 +6716,37 @@ export type FunctionParameters = { * */ export type FunctionToolCall = { - /** - * The unique ID of the function tool call. - * - */ - id?: string; - /** - * The type of the function tool call. Always `function_call`. - * - */ - type: 'function_call'; - /** - * The unique ID of the function tool call generated by the model. - * - */ - call_id: string; - /** - * The name of the function to run. - * - */ - name: string; - /** - * A JSON string of the arguments to pass to the function. - * - */ - arguments: string; - /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - */ - status?: 'in_progress' | 'completed' | 'incomplete'; + /** + * The unique ID of the function tool call. + * + */ + id?: string; + /** + * The type of the function tool call. Always `function_call`. + * + */ + type: 'function_call'; + /** + * The unique ID of the function tool call generated by the model. + * + */ + call_id: string; + /** + * The name of the function to run. + * + */ + name: string; + /** + * A JSON string of the arguments to pass to the function. + * + */ + arguments: string; + /** + * The status of the item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. + * + */ + status?: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -6526,49 +6756,49 @@ export type FunctionToolCall = { * */ export type FunctionToolCallOutput = { - /** - * The unique ID of the function tool call output. Populated when this item - * is returned via API. - * - */ - id?: string; - /** - * The type of the function tool call output. Always `function_call_output`. - * - */ - type: 'function_call_output'; - /** - * The unique ID of the function tool call generated by the model. - * - */ - call_id: string; - /** - * A JSON string of the output of the function tool call. - * - */ - output: string; - /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - */ - status?: 'in_progress' | 'completed' | 'incomplete'; + /** + * The unique ID of the function tool call output. Populated when this item + * is returned via API. + * + */ + id?: string; + /** + * The type of the function tool call output. Always `function_call_output`. + * + */ + type: 'function_call_output'; + /** + * The unique ID of the function tool call generated by the model. + * + */ + call_id: string; + /** + * A JSON string of the output of the function tool call. + * + */ + output: string; + /** + * The status of the item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. + * + */ + status?: 'in_progress' | 'completed' | 'incomplete'; }; export type FunctionToolCallOutputResource = FunctionToolCallOutput & { - /** - * The unique ID of the function call tool output. - * - */ - id: string; + /** + * The unique ID of the function call tool output. + * + */ + id: string; }; export type FunctionToolCallResource = FunctionToolCall & { - /** - * The unique ID of the function tool call. - * - */ - id: string; + /** + * The unique ID of the function tool call. + * + */ + id: string; }; /** @@ -6579,27 +6809,27 @@ export type FunctionToolCallResource = FunctionToolCall & { * */ export type GraderLabelModel = { - /** - * The object type, which is always `label_model`. - */ - type: 'label_model'; - /** - * The name of the grader. - */ - name: string; - /** - * The model to use for the evaluation. Must support structured outputs. - */ - model: string; - input: Array; - /** - * The labels to assign to each item in the evaluation. - */ - labels: Array; - /** - * The labels that indicate a passing result. Must be a subset of labels. - */ - passing_labels: Array; + /** + * The object type, which is always `label_model`. + */ + type: 'label_model'; + /** + * The name of the grader. + */ + name: string; + /** + * The model to use for the evaluation. Must support structured outputs. + */ + model: string; + input: Array; + /** + * The labels to assign to each item in the evaluation. + */ + labels: Array; + /** + * The labels that indicate a passing result. Must be a subset of labels. + */ + passing_labels: Array; }; /** @@ -6608,19 +6838,24 @@ export type GraderLabelModel = { * A MultiGrader object combines the output of multiple graders to produce a single score. */ export type GraderMulti = { - /** - * The object type, which is always `multi`. - */ - type: 'multi'; - /** - * The name of the grader. - */ - name: string; - graders: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderLabelModel; - /** - * A formula to calculate the output based on grader results. - */ - calculate_output: string; + /** + * The object type, which is always `multi`. + */ + type: 'multi'; + /** + * The name of the grader. + */ + name: string; + graders: + | GraderStringCheck + | GraderTextSimilarity + | GraderPython + | GraderScoreModel + | GraderLabelModel; + /** + * A formula to calculate the output based on grader results. + */ + calculate_output: string; }; /** @@ -6630,22 +6865,22 @@ export type GraderMulti = { * */ export type GraderPython = { - /** - * The object type, which is always `python`. - */ - type: 'python'; - /** - * The name of the grader. - */ - name: string; - /** - * The source code of the python script. - */ - source: string; - /** - * The image tag to use for the python script. - */ - image_tag?: string; + /** + * The object type, which is always `python`. + */ + type: 'python'; + /** + * The name of the grader. + */ + name: string; + /** + * The source code of the python script. + */ + source: string; + /** + * The image tag to use for the python script. + */ + image_tag?: string; }; /** @@ -6655,32 +6890,32 @@ export type GraderPython = { * */ export type GraderScoreModel = { - /** - * The object type, which is always `score_model`. - */ - type: 'score_model'; - /** - * The name of the grader. - */ - name: string; - /** - * The model to use for the evaluation. - */ - model: string; - /** - * The sampling parameters for the model. - */ - sampling_params?: { - [key: string]: unknown; - }; - /** - * The input text. This may include template strings. - */ - input: Array; - /** - * The range of the score. Defaults to `[0, 1]`. - */ - range?: Array; + /** + * The object type, which is always `score_model`. + */ + type: 'score_model'; + /** + * The name of the grader. + */ + name: string; + /** + * The model to use for the evaluation. + */ + model: string; + /** + * The sampling parameters for the model. + */ + sampling_params?: { + [key: string]: unknown; + }; + /** + * The input text. This may include template strings. + */ + input: Array; + /** + * The range of the score. Defaults to `[0, 1]`. + */ + range?: Array; }; /** @@ -6690,26 +6925,26 @@ export type GraderScoreModel = { * */ export type GraderStringCheck = { - /** - * The object type, which is always `string_check`. - */ - type: 'string_check'; - /** - * The name of the grader. - */ - name: string; - /** - * The input text. This may include template strings. - */ - input: string; - /** - * The reference text. This may include template strings. - */ - reference: string; - /** - * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. - */ - operation: 'eq' | 'ne' | 'like' | 'ilike'; + /** + * The object type, which is always `string_check`. + */ + type: 'string_check'; + /** + * The name of the grader. + */ + name: string; + /** + * The input text. This may include template strings. + */ + input: string; + /** + * The reference text. This may include template strings. + */ + reference: string; + /** + * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + */ + operation: 'eq' | 'ne' | 'like' | 'ilike'; }; /** @@ -6719,47 +6954,58 @@ export type GraderStringCheck = { * */ export type GraderTextSimilarity = { - /** - * The type of grader. - */ - type: 'text_similarity'; - /** - * The name of the grader. - */ - name: string; - /** - * The text being graded. - */ - input: string; - /** - * The text being graded against. - */ - reference: string; - /** - * The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, - * `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, - * or `rouge_l`. - * - */ - evaluation_metric: 'cosine' | 'fuzzy_match' | 'bleu' | 'gleu' | 'meteor' | 'rouge_1' | 'rouge_2' | 'rouge_3' | 'rouge_4' | 'rouge_5' | 'rouge_l'; + /** + * The type of grader. + */ + type: 'text_similarity'; + /** + * The name of the grader. + */ + name: string; + /** + * The text being graded. + */ + input: string; + /** + * The text being graded against. + */ + reference: string; + /** + * The evaluation metric to use. One of `cosine`, `fuzzy_match`, `bleu`, + * `gleu`, `meteor`, `rouge_1`, `rouge_2`, `rouge_3`, `rouge_4`, `rouge_5`, + * or `rouge_l`. + * + */ + evaluation_metric: + | 'cosine' + | 'fuzzy_match' + | 'bleu' + | 'gleu' + | 'meteor' + | 'rouge_1' + | 'rouge_2' + | 'rouge_3' + | 'rouge_4' + | 'rouge_5' + | 'rouge_l'; }; /** * Represents the content or the URL of an image generated by the OpenAI API. */ export type Image = { - /** - * The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`. - */ - b64_json?: string; - /** - * When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for `gpt-image-1`. - */ - url?: string; - /** - * For `dall-e-3` only, the revised prompt that was used to generate the image. - */ - revised_prompt?: string; + /** + * The base64-encoded JSON of the generated image. Default value for `gpt-image-1`, and only present if `response_format` is set to `b64_json` for `dall-e-2` and `dall-e-3`. + */ + b64_json?: string; + /** + * When using `dall-e-2` or `dall-e-3`, the URL of the generated image if `response_format` is set to `url` (default value). Unsupported for `gpt-image-1`. + */ + url?: string; + /** + * For `dall-e-3` only, the revised prompt that was used to generate the image. + */ + revised_prompt?: string; }; /** @@ -6767,138 +7013,140 @@ export type Image = { * */ export type ImageEditCompletedEvent = { - /** - * The type of the event. Always `image_edit.completed`. - * - */ - type: 'image_edit.completed'; - /** - * Base64-encoded final edited image data, suitable for rendering as an image. - * - */ - b64_json: string; - /** - * The Unix timestamp when the event was created. - * - */ - created_at: number; - /** - * The size of the edited image. - * - */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; - /** - * The quality setting for the edited image. - * - */ - quality: 'low' | 'medium' | 'high' | 'auto'; - /** - * The background setting for the edited image. - * - */ - background: 'transparent' | 'opaque' | 'auto'; - /** - * The output format for the edited image. - * - */ - output_format: 'png' | 'webp' | 'jpeg'; - usage: ImagesUsage; + /** + * The type of the event. Always `image_edit.completed`. + * + */ + type: 'image_edit.completed'; + /** + * Base64-encoded final edited image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The size of the edited image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The quality setting for the edited image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The background setting for the edited image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The output format for the edited image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + usage: ImagesUsage; }; /** * Emitted when a partial image is available during image editing streaming. * */ -export type ImageEditPartialImageEvent = { - /** - * The type of the event. Always `image_edit.partial_image`. - * - */ - type: 'image_edit.partial_image'; - /** - * Base64-encoded partial image data, suitable for rendering as an image. - * - */ - b64_json: string; - /** - * The Unix timestamp when the event was created. - * - */ - created_at: number; - /** - * The size of the requested edited image. - * - */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; - /** - * The quality setting for the requested edited image. - * - */ - quality: 'low' | 'medium' | 'high' | 'auto'; - /** - * The background setting for the requested edited image. - * - */ - background: 'transparent' | 'opaque' | 'auto'; - /** - * The output format for the requested edited image. - * - */ - output_format: 'png' | 'webp' | 'jpeg'; - /** - * 0-based index for the partial image (streaming). - * - */ - partial_image_index: number; -}; - -export type ImageEditStreamEvent = ({ - type?: 'ImageEditPartialImageEvent'; -} & ImageEditPartialImageEvent) | ({ - type?: 'ImageEditCompletedEvent'; -} & ImageEditCompletedEvent); +export type ImageEditPartialImageEvent = { + /** + * The type of the event. Always `image_edit.partial_image`. + * + */ + type: 'image_edit.partial_image'; + /** + * Base64-encoded partial image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The size of the requested edited image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The quality setting for the requested edited image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The background setting for the requested edited image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The output format for the requested edited image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + /** + * 0-based index for the partial image (streaming). + * + */ + partial_image_index: number; +}; + +export type ImageEditStreamEvent = + | ({ + type?: 'ImageEditPartialImageEvent'; + } & ImageEditPartialImageEvent) + | ({ + type?: 'ImageEditCompletedEvent'; + } & ImageEditCompletedEvent); /** * Emitted when image generation has completed and the final image is available. * */ export type ImageGenCompletedEvent = { - /** - * The type of the event. Always `image_generation.completed`. - * - */ - type: 'image_generation.completed'; - /** - * Base64-encoded image data, suitable for rendering as an image. - * - */ - b64_json: string; - /** - * The Unix timestamp when the event was created. - * - */ - created_at: number; - /** - * The size of the generated image. - * - */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; - /** - * The quality setting for the generated image. - * - */ - quality: 'low' | 'medium' | 'high' | 'auto'; - /** - * The background setting for the generated image. - * - */ - background: 'transparent' | 'opaque' | 'auto'; - /** - * The output format for the generated image. - * - */ - output_format: 'png' | 'webp' | 'jpeg'; - usage: ImagesUsage; + /** + * The type of the event. Always `image_generation.completed`. + * + */ + type: 'image_generation.completed'; + /** + * Base64-encoded image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The size of the generated image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The quality setting for the generated image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The background setting for the generated image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The output format for the generated image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + usage: ImagesUsage; }; /** @@ -6906,53 +7154,55 @@ export type ImageGenCompletedEvent = { * */ export type ImageGenPartialImageEvent = { - /** - * The type of the event. Always `image_generation.partial_image`. - * - */ - type: 'image_generation.partial_image'; - /** - * Base64-encoded partial image data, suitable for rendering as an image. - * - */ - b64_json: string; - /** - * The Unix timestamp when the event was created. - * - */ - created_at: number; - /** - * The size of the requested image. - * - */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; - /** - * The quality setting for the requested image. - * - */ - quality: 'low' | 'medium' | 'high' | 'auto'; - /** - * The background setting for the requested image. - * - */ - background: 'transparent' | 'opaque' | 'auto'; - /** - * The output format for the requested image. - * - */ - output_format: 'png' | 'webp' | 'jpeg'; - /** - * 0-based index for the partial image (streaming). - * - */ - partial_image_index: number; -}; - -export type ImageGenStreamEvent = ({ - type?: 'ImageGenPartialImageEvent'; -} & ImageGenPartialImageEvent) | ({ - type?: 'ImageGenCompletedEvent'; -} & ImageGenCompletedEvent); + /** + * The type of the event. Always `image_generation.partial_image`. + * + */ + type: 'image_generation.partial_image'; + /** + * Base64-encoded partial image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The size of the requested image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The quality setting for the requested image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The background setting for the requested image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The output format for the requested image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + /** + * 0-based index for the partial image (streaming). + * + */ + partial_image_index: number; +}; + +export type ImageGenStreamEvent = + | ({ + type?: 'ImageGenPartialImageEvent'; + } & ImageGenPartialImageEvent) + | ({ + type?: 'ImageGenCompletedEvent'; + } & ImageGenCompletedEvent); /** * Image generation tool @@ -6961,73 +7211,73 @@ export type ImageGenStreamEvent = ({ * */ export type ImageGenTool = { - /** - * The type of the image generation tool. Always `image_generation`. - * - */ - type: 'image_generation'; - /** - * The image generation model to use. Default: `gpt-image-1`. - * - */ - model?: 'gpt-image-1'; - /** - * The quality of the generated image. One of `low`, `medium`, `high`, - * or `auto`. Default: `auto`. - * - */ - quality?: 'low' | 'medium' | 'high' | 'auto'; - /** - * The size of the generated image. One of `1024x1024`, `1024x1536`, - * `1536x1024`, or `auto`. Default: `auto`. - * - */ - size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; - /** - * The output format of the generated image. One of `png`, `webp`, or - * `jpeg`. Default: `png`. - * - */ - output_format?: 'png' | 'webp' | 'jpeg'; - /** - * Compression level for the output image. Default: 100. - * - */ - output_compression?: number; - /** - * Moderation level for the generated image. Default: `auto`. - * - */ - moderation?: 'auto' | 'low'; - /** - * Background type for the generated image. One of `transparent`, - * `opaque`, or `auto`. Default: `auto`. + /** + * The type of the image generation tool. Always `image_generation`. + * + */ + type: 'image_generation'; + /** + * The image generation model to use. Default: `gpt-image-1`. + * + */ + model?: 'gpt-image-1'; + /** + * The quality of the generated image. One of `low`, `medium`, `high`, + * or `auto`. Default: `auto`. + * + */ + quality?: 'low' | 'medium' | 'high' | 'auto'; + /** + * The size of the generated image. One of `1024x1024`, `1024x1536`, + * `1536x1024`, or `auto`. Default: `auto`. + * + */ + size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The output format of the generated image. One of `png`, `webp`, or + * `jpeg`. Default: `png`. + * + */ + output_format?: 'png' | 'webp' | 'jpeg'; + /** + * Compression level for the output image. Default: 100. + * + */ + output_compression?: number; + /** + * Moderation level for the generated image. Default: `auto`. + * + */ + moderation?: 'auto' | 'low'; + /** + * Background type for the generated image. One of `transparent`, + * `opaque`, or `auto`. Default: `auto`. + * + */ + background?: 'transparent' | 'opaque' | 'auto'; + input_fidelity?: ImageInputFidelity; + /** + * Optional mask for inpainting. Contains `image_url` + * (string, optional) and `file_id` (string, optional). + * + */ + input_image_mask?: { + /** + * Base64-encoded mask image. * */ - background?: 'transparent' | 'opaque' | 'auto'; - input_fidelity?: ImageInputFidelity; - /** - * Optional mask for inpainting. Contains `image_url` - * (string, optional) and `file_id` (string, optional). - * - */ - input_image_mask?: { - /** - * Base64-encoded mask image. - * - */ - image_url?: string; - /** - * File ID for the mask image. - * - */ - file_id?: string; - }; + image_url?: string; /** - * Number of partial images to generate in streaming mode, from 0 (default value) to 3. + * File ID for the mask image. * */ - partial_images?: number; + file_id?: string; + }; + /** + * Number of partial images to generate in streaming mode, from 0 (default value) to 3. + * + */ + partial_images?: number; }; /** @@ -7037,26 +7287,26 @@ export type ImageGenTool = { * */ export type ImageGenToolCall = { - /** - * The type of the image generation call. Always `image_generation_call`. - * - */ - type: 'image_generation_call'; - /** - * The unique ID of the image generation call. - * - */ - id: string; - /** - * The status of the image generation call. - * - */ - status: 'in_progress' | 'completed' | 'generating' | 'failed'; - /** - * The generated image encoded in base64. - * - */ - result: string; + /** + * The type of the image generation call. Always `image_generation_call`. + * + */ + type: 'image_generation_call'; + /** + * The unique ID of the image generation call. + * + */ + id: string; + /** + * The status of the image generation call. + * + */ + status: 'in_progress' | 'completed' | 'generating' | 'failed'; + /** + * The generated image encoded in base64. + * + */ + result: string; }; /** @@ -7073,7 +7323,7 @@ export const ImageInputFidelity = { HIGH: 'high', LOW: 'low' } as const; * for `gpt-image-1`. Supports `high` and `low`. Defaults to `low`. * */ -export type ImageInputFidelity = typeof ImageInputFidelity[keyof typeof ImageInputFidelity]; +export type ImageInputFidelity = (typeof ImageInputFidelity)[keyof typeof ImageInputFidelity]; /** * Image generation response @@ -7081,31 +7331,31 @@ export type ImageInputFidelity = typeof ImageInputFidelity[keyof typeof ImageInp * The response from the image generation endpoint. */ export type ImagesResponse = { - /** - * The Unix timestamp (in seconds) of when the image was created. - */ - created: number; - /** - * The list of generated images. - */ - data?: Array; - /** - * The background parameter used for the image generation. Either `transparent` or `opaque`. - */ - background?: 'transparent' | 'opaque'; - /** - * The output format of the image generation. Either `png`, `webp`, or `jpeg`. - */ - output_format?: 'png' | 'webp' | 'jpeg'; - /** - * The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`. - */ - size?: '1024x1024' | '1024x1536' | '1536x1024'; - /** - * The quality of the image generated. Either `low`, `medium`, or `high`. - */ - quality?: 'low' | 'medium' | 'high'; - usage?: ImageGenUsage; + /** + * The Unix timestamp (in seconds) of when the image was created. + */ + created: number; + /** + * The list of generated images. + */ + data?: Array; + /** + * The background parameter used for the image generation. Either `transparent` or `opaque`. + */ + background?: 'transparent' | 'opaque'; + /** + * The output format of the image generation. Either `png`, `webp`, or `jpeg`. + */ + output_format?: 'png' | 'webp' | 'jpeg'; + /** + * The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`. + */ + size?: '1024x1024' | '1024x1536' | '1536x1024'; + /** + * The quality of the image generated. Either `low`, `medium`, or `high`. + */ + quality?: 'low' | 'medium' | 'high'; + usage?: ImageGenUsage; }; /** @@ -7113,32 +7363,32 @@ export type ImagesResponse = { * */ export type ImagesUsage = { + /** + * The total number of tokens (images and text) used for the image generation. + * + */ + total_tokens: number; + /** + * The number of tokens (images and text) in the input prompt. + */ + input_tokens: number; + /** + * The number of image tokens in the output image. + */ + output_tokens: number; + /** + * The input tokens detailed information for the image generation. + */ + input_tokens_details: { /** - * The total number of tokens (images and text) used for the image generation. - * - */ - total_tokens: number; - /** - * The number of tokens (images and text) in the input prompt. - */ - input_tokens: number; - /** - * The number of image tokens in the output image. + * The number of text tokens in the input prompt. */ - output_tokens: number; + text_tokens: number; /** - * The input tokens detailed information for the image generation. + * The number of image tokens in the input prompt. */ - input_tokens_details: { - /** - * The number of text tokens in the input prompt. - */ - text_tokens: number; - /** - * The number of image tokens in the input prompt. - */ - image_tokens: number; - }; + image_tokens: number; + }; }; /** @@ -7159,12 +7409,12 @@ export type ImagesUsage = { * */ export const Includable = { - CODE_INTERPRETER_CALL_OUTPUTS: 'code_interpreter_call.outputs', - COMPUTER_CALL_OUTPUT_OUTPUT_IMAGE_URL: 'computer_call_output.output.image_url', - FILE_SEARCH_CALL_RESULTS: 'file_search_call.results', - MESSAGE_INPUT_IMAGE_IMAGE_URL: 'message.input_image.image_url', - MESSAGE_OUTPUT_TEXT_LOGPROBS: 'message.output_text.logprobs', - REASONING_ENCRYPTED_CONTENT: 'reasoning.encrypted_content' + CODE_INTERPRETER_CALL_OUTPUTS: 'code_interpreter_call.outputs', + COMPUTER_CALL_OUTPUT_OUTPUT_IMAGE_URL: 'computer_call_output.output.image_url', + FILE_SEARCH_CALL_RESULTS: 'file_search_call.results', + MESSAGE_INPUT_IMAGE_IMAGE_URL: 'message.input_image.image_url', + MESSAGE_OUTPUT_TEXT_LOGPROBS: 'message.output_text.logprobs', + REASONING_ENCRYPTED_CONTENT: 'reasoning.encrypted_content', } as const; /** @@ -7184,7 +7434,7 @@ export const Includable = { * enrolled in the zero data retention program). * */ -export type Includable = typeof Includable[keyof typeof Includable]; +export type Includable = (typeof Includable)[keyof typeof Includable]; /** * Audio input @@ -7193,39 +7443,45 @@ export type Includable = typeof Includable[keyof typeof Includable]; * */ export type InputAudio = { - /** - * The type of the input item. Always `input_audio`. - * - */ - type: 'input_audio'; - /** - * Base64-encoded audio data. - * - */ - data: string; - /** - * The format of the audio data. Currently supported formats are `mp3` and - * `wav`. - * - */ - format: 'mp3' | 'wav'; -}; - -export type InputContent = ({ - type?: 'InputTextContent'; -} & InputTextContent) | ({ - type?: 'InputImageContent'; -} & InputImageContent) | ({ - type?: 'InputFileContent'; -} & InputFileContent); - -export type InputItem = ({ - type?: 'EasyInputMessage'; -} & EasyInputMessage) | ({ - type?: 'Item'; -} & Item) | ({ - type?: 'ItemReferenceParam'; -} & ItemReferenceParam); + /** + * The type of the input item. Always `input_audio`. + * + */ + type: 'input_audio'; + /** + * Base64-encoded audio data. + * + */ + data: string; + /** + * The format of the audio data. Currently supported formats are `mp3` and + * `wav`. + * + */ + format: 'mp3' | 'wav'; +}; + +export type InputContent = + | ({ + type?: 'InputTextContent'; + } & InputTextContent) + | ({ + type?: 'InputImageContent'; + } & InputImageContent) + | ({ + type?: 'InputFileContent'; + } & InputFileContent); + +export type InputItem = + | ({ + type?: 'EasyInputMessage'; + } & EasyInputMessage) + | ({ + type?: 'Item'; + } & Item) + | ({ + type?: 'ItemReferenceParam'; + } & ItemReferenceParam); /** * Input message @@ -7236,23 +7492,23 @@ export type InputItem = ({ * */ export type InputMessage = { - /** - * The type of the message input. Always set to `message`. - * - */ - type?: 'message'; - /** - * The role of the message input. One of `user`, `system`, or `developer`. - * - */ - role: 'user' | 'system' | 'developer'; - /** - * The status of item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. - * - */ - status?: 'in_progress' | 'completed' | 'incomplete'; - content: InputMessageContentList; + /** + * The type of the message input. Always set to `message`. + * + */ + type?: 'message'; + /** + * The role of the message input. One of `user`, `system`, or `developer`. + * + */ + role: 'user' | 'system' | 'developer'; + /** + * The status of item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. + * + */ + status?: 'in_progress' | 'completed' | 'incomplete'; + content: InputMessageContentList; }; /** @@ -7265,198 +7521,233 @@ export type InputMessage = { export type InputMessageContentList = Array; export type InputMessageResource = InputMessage & { - /** - * The unique ID of the message input. - * - */ - id: string; + /** + * The unique ID of the message input. + * + */ + id: string; }; /** * Represents an individual `invite` to the organization. */ export type Invite = { - /** - * The object type, which is always `organization.invite` - */ - object: 'organization.invite'; - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - /** - * The email address of the individual to whom the invite was sent - */ - email: string; - /** - * `owner` or `reader` - */ - role: 'owner' | 'reader'; - /** - * `accepted`,`expired`, or `pending` - */ - status: 'accepted' | 'expired' | 'pending'; - /** - * The Unix timestamp (in seconds) of when the invite was sent. - */ - invited_at: number; - /** - * The Unix timestamp (in seconds) of when the invite expires. - */ - expires_at: number; - /** - * The Unix timestamp (in seconds) of when the invite was accepted. + /** + * The object type, which is always `organization.invite` + */ + object: 'organization.invite'; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The email address of the individual to whom the invite was sent + */ + email: string; + /** + * `owner` or `reader` + */ + role: 'owner' | 'reader'; + /** + * `accepted`,`expired`, or `pending` + */ + status: 'accepted' | 'expired' | 'pending'; + /** + * The Unix timestamp (in seconds) of when the invite was sent. + */ + invited_at: number; + /** + * The Unix timestamp (in seconds) of when the invite expires. + */ + expires_at: number; + /** + * The Unix timestamp (in seconds) of when the invite was accepted. + */ + accepted_at?: number; + /** + * The projects that were granted membership upon acceptance of the invite. + */ + projects?: Array<{ + /** + * Project's public ID */ - accepted_at?: number; + id?: string; /** - * The projects that were granted membership upon acceptance of the invite. + * Project membership role */ - projects?: Array<{ - /** - * Project's public ID - */ - id?: string; - /** - * Project membership role - */ - role?: 'member' | 'owner'; - }>; + role?: 'member' | 'owner'; + }>; }; export type InviteDeleteResponse = { - /** - * The object type, which is always `organization.invite.deleted` - */ - object: 'organization.invite.deleted'; - id: string; - deleted: boolean; + /** + * The object type, which is always `organization.invite.deleted` + */ + object: 'organization.invite.deleted'; + id: string; + deleted: boolean; }; export type InviteListResponse = { - /** - * The object type, which is always `list` - */ - object: 'list'; - data: Array; - /** - * The first `invite_id` in the retrieved `list` - */ - first_id?: string; - /** - * The last `invite_id` in the retrieved `list` - */ - last_id?: string; - /** - * The `has_more` property is used for pagination to indicate there are additional results. - */ - has_more?: boolean; + /** + * The object type, which is always `list` + */ + object: 'list'; + data: Array; + /** + * The first `invite_id` in the retrieved `list` + */ + first_id?: string; + /** + * The last `invite_id` in the retrieved `list` + */ + last_id?: string; + /** + * The `has_more` property is used for pagination to indicate there are additional results. + */ + has_more?: boolean; }; export type InviteRequest = { - /** - * Send an email to this address - */ - email: string; - /** - * `owner` or `reader` + /** + * Send an email to this address + */ + email: string; + /** + * `owner` or `reader` + */ + role: 'reader' | 'owner'; + /** + * An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. + */ + projects?: Array<{ + /** + * Project's public ID */ - role: 'reader' | 'owner'; + id: string; /** - * An array of projects to which membership is granted at the same time the org invite is accepted. If omitted, the user will be invited to the default project for compatibility with legacy behavior. + * Project membership role */ - projects?: Array<{ - /** - * Project's public ID - */ - id: string; - /** - * Project membership role - */ - role: 'member' | 'owner'; - }>; + role: 'member' | 'owner'; + }>; }; /** * Content item used to generate a response. * */ -export type Item = ({ - type?: 'InputMessage'; -} & InputMessage) | ({ - type?: 'OutputMessage'; -} & OutputMessage) | ({ - type?: 'FileSearchToolCall'; -} & FileSearchToolCall) | ({ - type?: 'ComputerToolCall'; -} & ComputerToolCall) | ({ - type?: 'ComputerCallOutputItemParam'; -} & ComputerCallOutputItemParam) | ({ - type?: 'WebSearchToolCall'; -} & WebSearchToolCall) | ({ - type?: 'FunctionToolCall'; -} & FunctionToolCall) | ({ - type?: 'FunctionCallOutputItemParam'; -} & FunctionCallOutputItemParam) | ({ - type?: 'ReasoningItem'; -} & ReasoningItem) | ({ - type?: 'ImageGenToolCall'; -} & ImageGenToolCall) | ({ - type?: 'CodeInterpreterToolCall'; -} & CodeInterpreterToolCall) | ({ - type?: 'LocalShellToolCall'; -} & LocalShellToolCall) | ({ - type?: 'LocalShellToolCallOutput'; -} & LocalShellToolCallOutput) | ({ - type?: 'MCPListTools'; -} & McpListTools) | ({ - type?: 'MCPApprovalRequest'; -} & McpApprovalRequest) | ({ - type?: 'MCPApprovalResponse'; -} & McpApprovalResponse) | ({ - type?: 'MCPToolCall'; -} & McpToolCall) | ({ - type?: 'CustomToolCallOutput'; -} & CustomToolCallOutput) | ({ - type?: 'CustomToolCall'; -} & CustomToolCall); +export type Item = + | ({ + type?: 'InputMessage'; + } & InputMessage) + | ({ + type?: 'OutputMessage'; + } & OutputMessage) + | ({ + type?: 'FileSearchToolCall'; + } & FileSearchToolCall) + | ({ + type?: 'ComputerToolCall'; + } & ComputerToolCall) + | ({ + type?: 'ComputerCallOutputItemParam'; + } & ComputerCallOutputItemParam) + | ({ + type?: 'WebSearchToolCall'; + } & WebSearchToolCall) + | ({ + type?: 'FunctionToolCall'; + } & FunctionToolCall) + | ({ + type?: 'FunctionCallOutputItemParam'; + } & FunctionCallOutputItemParam) + | ({ + type?: 'ReasoningItem'; + } & ReasoningItem) + | ({ + type?: 'ImageGenToolCall'; + } & ImageGenToolCall) + | ({ + type?: 'CodeInterpreterToolCall'; + } & CodeInterpreterToolCall) + | ({ + type?: 'LocalShellToolCall'; + } & LocalShellToolCall) + | ({ + type?: 'LocalShellToolCallOutput'; + } & LocalShellToolCallOutput) + | ({ + type?: 'MCPListTools'; + } & McpListTools) + | ({ + type?: 'MCPApprovalRequest'; + } & McpApprovalRequest) + | ({ + type?: 'MCPApprovalResponse'; + } & McpApprovalResponse) + | ({ + type?: 'MCPToolCall'; + } & McpToolCall) + | ({ + type?: 'CustomToolCallOutput'; + } & CustomToolCallOutput) + | ({ + type?: 'CustomToolCall'; + } & CustomToolCall); /** * Content item used to generate a response. * */ -export type ItemResource = ({ - type?: 'InputMessageResource'; -} & InputMessageResource) | ({ - type?: 'OutputMessage'; -} & OutputMessage) | ({ - type?: 'FileSearchToolCall'; -} & FileSearchToolCall) | ({ - type?: 'ComputerToolCall'; -} & ComputerToolCall) | ({ - type?: 'ComputerToolCallOutputResource'; -} & ComputerToolCallOutputResource) | ({ - type?: 'WebSearchToolCall'; -} & WebSearchToolCall) | ({ - type?: 'FunctionToolCallResource'; -} & FunctionToolCallResource) | ({ - type?: 'FunctionToolCallOutputResource'; -} & FunctionToolCallOutputResource) | ({ - type?: 'ImageGenToolCall'; -} & ImageGenToolCall) | ({ - type?: 'CodeInterpreterToolCall'; -} & CodeInterpreterToolCall) | ({ - type?: 'LocalShellToolCall'; -} & LocalShellToolCall) | ({ - type?: 'LocalShellToolCallOutput'; -} & LocalShellToolCallOutput) | ({ - type?: 'MCPListTools'; -} & McpListTools) | ({ - type?: 'MCPApprovalRequest'; -} & McpApprovalRequest) | ({ - type?: 'MCPApprovalResponseResource'; -} & McpApprovalResponseResource) | ({ - type?: 'MCPToolCall'; -} & McpToolCall); +export type ItemResource = + | ({ + type?: 'InputMessageResource'; + } & InputMessageResource) + | ({ + type?: 'OutputMessage'; + } & OutputMessage) + | ({ + type?: 'FileSearchToolCall'; + } & FileSearchToolCall) + | ({ + type?: 'ComputerToolCall'; + } & ComputerToolCall) + | ({ + type?: 'ComputerToolCallOutputResource'; + } & ComputerToolCallOutputResource) + | ({ + type?: 'WebSearchToolCall'; + } & WebSearchToolCall) + | ({ + type?: 'FunctionToolCallResource'; + } & FunctionToolCallResource) + | ({ + type?: 'FunctionToolCallOutputResource'; + } & FunctionToolCallOutputResource) + | ({ + type?: 'ImageGenToolCall'; + } & ImageGenToolCall) + | ({ + type?: 'CodeInterpreterToolCall'; + } & CodeInterpreterToolCall) + | ({ + type?: 'LocalShellToolCall'; + } & LocalShellToolCall) + | ({ + type?: 'LocalShellToolCallOutput'; + } & LocalShellToolCallOutput) + | ({ + type?: 'MCPListTools'; + } & McpListTools) + | ({ + type?: 'MCPApprovalRequest'; + } & McpApprovalRequest) + | ({ + type?: 'MCPApprovalResponseResource'; + } & McpApprovalResponseResource) + | ({ + type?: 'MCPToolCall'; + } & McpToolCall); /** * KeyPress @@ -7465,131 +7756,131 @@ export type ItemResource = ({ * */ export type KeyPress = { - /** - * Specifies the event type. For a keypress action, this property is - * always set to `keypress`. - * - */ - type: 'keypress'; - /** - * The combination of keys the model is requesting to be pressed. This is an - * array of strings, each representing a key. - * - */ - keys: Array; + /** + * Specifies the event type. For a keypress action, this property is + * always set to `keypress`. + * + */ + type: 'keypress'; + /** + * The combination of keys the model is requesting to be pressed. This is an + * array of strings, each representing a key. + * + */ + keys: Array; }; export type ListAssistantsResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListAuditLogsResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: 'list'; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListBatchesResponse = { - data: Array; - first_id?: string; - last_id?: string; - has_more: boolean; - object: 'list'; + data: Array; + first_id?: string; + last_id?: string; + has_more: boolean; + object: 'list'; }; export type ListCertificatesResponse = { - data: Array; - first_id?: string; - last_id?: string; - has_more: boolean; - object: 'list'; + data: Array; + first_id?: string; + last_id?: string; + has_more: boolean; + object: 'list'; }; export type ListFilesResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListFineTuningCheckpointPermissionResponse = { - data: Array; - object: 'list'; - first_id?: string; - last_id?: string; - has_more: boolean; + data: Array; + object: 'list'; + first_id?: string; + last_id?: string; + has_more: boolean; }; export type ListFineTuningJobCheckpointsResponse = { - data: Array; - object: 'list'; - first_id?: string; - last_id?: string; - has_more: boolean; + data: Array; + object: 'list'; + first_id?: string; + last_id?: string; + has_more: boolean; }; export type ListFineTuningJobEventsResponse = { - data: Array; - object: 'list'; - has_more: boolean; + data: Array; + object: 'list'; + has_more: boolean; }; export type ListMessagesResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListModelsResponse = { - object: 'list'; - data: Array; + object: 'list'; + data: Array; }; export type ListPaginatedFineTuningJobsResponse = { - data: Array; - has_more: boolean; - object: 'list'; + data: Array; + has_more: boolean; + object: 'list'; }; export type ListRunStepsResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListRunsResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListVectorStoreFilesResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ListVectorStoresResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; /** @@ -7599,38 +7890,38 @@ export type ListVectorStoresResponse = { * */ export type LocalShellExecAction = { - /** - * The type of the local shell action. Always `exec`. - * - */ - type: 'exec'; - /** - * The command to run. - * - */ - command: Array; - /** - * Optional timeout in milliseconds for the command. - * - */ - timeout_ms?: number; - /** - * Optional working directory to run the command in. - * - */ - working_directory?: string; - /** - * Environment variables to set for the command. - * - */ - env: { - [key: string]: string; - }; - /** - * Optional user to run the command as. - * - */ - user?: string; + /** + * The type of the local shell action. Always `exec`. + * + */ + type: 'exec'; + /** + * The command to run. + * + */ + command: Array; + /** + * Optional timeout in milliseconds for the command. + * + */ + timeout_ms?: number; + /** + * Optional working directory to run the command in. + * + */ + working_directory?: string; + /** + * Environment variables to set for the command. + * + */ + env: { + [key: string]: string; + }; + /** + * Optional user to run the command as. + * + */ + user?: string; }; /** @@ -7638,42 +7929,42 @@ export type LocalShellExecAction = { * * A tool that allows the model to execute shell commands in a local environment. * - */ -export type LocalShellTool = { - /** - * The type of the local shell tool. Always `local_shell`. - */ - type: 'local_shell'; -}; - -/** - * Local shell call - * - * A tool call to run a command on the local shell. - * - */ -export type LocalShellToolCall = { - /** - * The type of the local shell call. Always `local_shell_call`. - * - */ - type: 'local_shell_call'; - /** - * The unique ID of the local shell call. - * - */ - id: string; - /** - * The unique ID of the local shell tool call generated by the model. - * - */ - call_id: string; - action: LocalShellExecAction; - /** - * The status of the local shell call. - * - */ - status: 'in_progress' | 'completed' | 'incomplete'; + */ +export type LocalShellTool = { + /** + * The type of the local shell tool. Always `local_shell`. + */ + type: 'local_shell'; +}; + +/** + * Local shell call + * + * A tool call to run a command on the local shell. + * + */ +export type LocalShellToolCall = { + /** + * The type of the local shell call. Always `local_shell_call`. + * + */ + type: 'local_shell_call'; + /** + * The unique ID of the local shell call. + * + */ + id: string; + /** + * The unique ID of the local shell tool call generated by the model. + * + */ + call_id: string; + action: LocalShellExecAction; + /** + * The status of the local shell call. + * + */ + status: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -7683,26 +7974,26 @@ export type LocalShellToolCall = { * */ export type LocalShellToolCallOutput = { - /** - * The type of the local shell tool call output. Always `local_shell_call_output`. - * - */ - type: 'local_shell_call_output'; - /** - * The unique ID of the local shell tool call generated by the model. - * - */ - id: string; - /** - * A JSON string of the output of the local shell tool call. - * - */ - output: string; - /** - * The status of the item. One of `in_progress`, `completed`, or `incomplete`. - * - */ - status?: 'in_progress' | 'completed' | 'incomplete'; + /** + * The type of the local shell tool call output. Always `local_shell_call_output`. + * + */ + type: 'local_shell_call_output'; + /** + * The unique ID of the local shell tool call generated by the model. + * + */ + id: string; + /** + * A JSON string of the output of the local shell tool call. + * + */ + output: string; + /** + * The status of the item. One of `in_progress`, `completed`, or `incomplete`. + * + */ + status?: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -7710,21 +8001,21 @@ export type LocalShellToolCallOutput = { * */ export type LogProbProperties = { - /** - * The token that was used to generate the log probability. - * - */ - token: string; - /** - * The log probability of the token. - * - */ - logprob: number; - /** - * The bytes that were used to generate the log probability. - * - */ - bytes: Array; + /** + * The token that was used to generate the log probability. + * + */ + token: string; + /** + * The log probability of the token. + * + */ + logprob: number; + /** + * The bytes that were used to generate the log probability. + * + */ + bytes: Array; }; /** @@ -7734,31 +8025,31 @@ export type LogProbProperties = { * */ export type McpApprovalRequest = { - /** - * The type of the item. Always `mcp_approval_request`. - * - */ - type: 'mcp_approval_request'; - /** - * The unique ID of the approval request. - * - */ - id: string; - /** - * The label of the MCP server making the request. - * - */ - server_label: string; - /** - * The name of the tool to run. - * - */ - name: string; - /** - * A JSON string of arguments for the tool. - * - */ - arguments: string; + /** + * The type of the item. Always `mcp_approval_request`. + * + */ + type: 'mcp_approval_request'; + /** + * The unique ID of the approval request. + * + */ + id: string; + /** + * The label of the MCP server making the request. + * + */ + server_label: string; + /** + * The name of the tool to run. + * + */ + name: string; + /** + * A JSON string of arguments for the tool. + * + */ + arguments: string; }; /** @@ -7768,31 +8059,31 @@ export type McpApprovalRequest = { * */ export type McpApprovalResponse = { - /** - * The type of the item. Always `mcp_approval_response`. - * - */ - type: 'mcp_approval_response'; - /** - * The unique ID of the approval response - * - */ - id?: string; - /** - * The ID of the approval request being answered. - * - */ - approval_request_id: string; - /** - * Whether the request was approved. - * - */ - approve: boolean; - /** - * Optional reason for the decision. - * - */ - reason?: string; + /** + * The type of the item. Always `mcp_approval_response`. + * + */ + type: 'mcp_approval_response'; + /** + * The unique ID of the approval response + * + */ + id?: string; + /** + * The ID of the approval request being answered. + * + */ + approval_request_id: string; + /** + * Whether the request was approved. + * + */ + approve: boolean; + /** + * Optional reason for the decision. + * + */ + reason?: string; }; /** @@ -7802,31 +8093,31 @@ export type McpApprovalResponse = { * */ export type McpApprovalResponseResource = { - /** - * The type of the item. Always `mcp_approval_response`. - * - */ - type: 'mcp_approval_response'; - /** - * The unique ID of the approval response - * - */ - id: string; - /** - * The ID of the approval request being answered. - * - */ - approval_request_id: string; - /** - * Whether the request was approved. - * - */ - approve: boolean; - /** - * Optional reason for the decision. - * - */ - reason?: string; + /** + * The type of the item. Always `mcp_approval_response`. + * + */ + type: 'mcp_approval_response'; + /** + * The unique ID of the approval response + * + */ + id: string; + /** + * The ID of the approval request being answered. + * + */ + approval_request_id: string; + /** + * Whether the request was approved. + * + */ + approve: boolean; + /** + * Optional reason for the decision. + * + */ + reason?: string; }; /** @@ -7836,31 +8127,31 @@ export type McpApprovalResponseResource = { * */ export type McpListTools = { - /** - * The type of the item. Always `mcp_list_tools`. - * - */ - type: 'mcp_list_tools'; - /** - * The unique ID of the list. - * - */ - id: string; - /** - * The label of the MCP server. - * - */ - server_label: string; - /** - * The tools available on the server. - * - */ - tools: Array; - /** - * Error message if the server could not list tools. - * - */ - error?: string; + /** + * The type of the item. Always `mcp_list_tools`. + * + */ + type: 'mcp_list_tools'; + /** + * The unique ID of the list. + * + */ + id: string; + /** + * The label of the MCP server. + * + */ + server_label: string; + /** + * The tools available on the server. + * + */ + tools: Array; + /** + * Error message if the server could not list tools. + * + */ + error?: string; }; /** @@ -7870,30 +8161,30 @@ export type McpListTools = { * */ export type McpListToolsTool = { - /** - * The name of the tool. - * - */ - name: string; - /** - * The description of the tool. - * - */ - description?: string; - /** - * The JSON schema describing the tool's input. - * - */ - input_schema: { - [key: string]: unknown; - }; - /** - * Additional annotations about the tool. - * - */ - annotations?: { - [key: string]: unknown; - }; + /** + * The name of the tool. + * + */ + name: string; + /** + * The description of the tool. + * + */ + description?: string; + /** + * The JSON schema describing the tool's input. + * + */ + input_schema: { + [key: string]: unknown; + }; + /** + * Additional annotations about the tool. + * + */ + annotations?: { + [key: string]: unknown; + }; }; /** @@ -7904,70 +8195,75 @@ export type McpListToolsTool = { * */ export type McpTool = { - /** - * The type of the MCP tool. Always `mcp`. - */ - type: 'mcp'; - /** - * A label for this MCP server, used to identify it in tool calls. - * - */ - server_label: string; - /** - * The URL for the MCP server. - * - */ - server_url: string; - /** - * Optional description of the MCP server, used to provide more context. - * - */ - server_description?: string; - /** - * Optional HTTP headers to send to the MCP server. Use for authentication - * or other purposes. - * - */ - headers?: { - [key: string]: string; - }; - /** - * List of allowed tool names or a filter object. - * - */ - allowed_tools?: Array | { + /** + * The type of the MCP tool. Always `mcp`. + */ + type: 'mcp'; + /** + * A label for this MCP server, used to identify it in tool calls. + * + */ + server_label: string; + /** + * The URL for the MCP server. + * + */ + server_url: string; + /** + * Optional description of the MCP server, used to provide more context. + * + */ + server_description?: string; + /** + * Optional HTTP headers to send to the MCP server. Use for authentication + * or other purposes. + * + */ + headers?: { + [key: string]: string; + }; + /** + * List of allowed tool names or a filter object. + * + */ + allowed_tools?: + | Array + | { /** * MCP allowed tools * * List of allowed tool names. */ tool_names?: Array; - }; - /** - * Specify which of the MCP server's tools require approval. - */ - require_approval?: { + }; + /** + * Specify which of the MCP server's tools require approval. + */ + require_approval?: + | { /** * A list of tools that always require approval. * */ always?: { - /** - * List of tools that require approval. - */ - tool_names?: Array; + /** + * List of tools that require approval. + */ + tool_names?: Array; }; /** * A list of tools that never require approval. * */ never?: { - /** - * List of tools that do not require approval. - */ - tool_names?: Array; + /** + * List of tools that do not require approval. + */ + tool_names?: Array; }; - } | 'always' | 'never'; + } + | 'always' + | 'never'; }; /** @@ -7977,41 +8273,41 @@ export type McpTool = { * */ export type McpToolCall = { - /** - * The type of the item. Always `mcp_call`. - * - */ - type: 'mcp_call'; - /** - * The unique ID of the tool call. - * - */ - id: string; - /** - * The label of the MCP server running the tool. - * - */ - server_label: string; - /** - * The name of the tool that was run. - * - */ - name: string; - /** - * A JSON string of the arguments passed to the tool. - * - */ - arguments: string; - /** - * The output from the tool call. - * - */ - output?: string; - /** - * The error from the tool call, if any. - * - */ - error?: string; + /** + * The type of the item. Always `mcp_call`. + * + */ + type: 'mcp_call'; + /** + * The unique ID of the tool call. + * + */ + id: string; + /** + * The label of the MCP server running the tool. + * + */ + server_label: string; + /** + * The name of the tool that was run. + * + */ + name: string; + /** + * A JSON string of the arguments passed to the tool. + * + */ + arguments: string; + /** + * The output from the tool call. + * + */ + output?: string; + /** + * The error from the tool call, if any. + * + */ + error?: string; }; /** @@ -8020,20 +8316,20 @@ export type McpToolCall = { * References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. */ export type MessageContentImageFileObject = { + /** + * Always `image_file`. + */ + type: 'image_file'; + image_file: { /** - * Always `image_file`. + * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. */ - type: 'image_file'; - image_file: { - /** - * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - */ - file_id: string; - /** - * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - */ - detail?: 'auto' | 'low' | 'high'; - }; + file_id: string; + /** + * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. + */ + detail?: 'auto' | 'low' | 'high'; + }; }; /** @@ -8042,20 +8338,20 @@ export type MessageContentImageFileObject = { * References an image URL in the content of a message. */ export type MessageContentImageUrlObject = { + /** + * The type of the content part. + */ + type: 'image_url'; + image_url: { /** - * The type of the content part. + * The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. */ - type: 'image_url'; - image_url: { - /** - * The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - */ - url: string; - /** - * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` - */ - detail?: 'auto' | 'low' | 'high'; - }; + url: string; + /** + * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` + */ + detail?: 'auto' | 'low' | 'high'; + }; }; /** @@ -8064,11 +8360,11 @@ export type MessageContentImageUrlObject = { * The refusal content generated by the assistant. */ export type MessageContentRefusalObject = { - /** - * Always `refusal`. - */ - type: 'refusal'; - refusal: string; + /** + * Always `refusal`. + */ + type: 'refusal'; + refusal: string; }; /** @@ -8077,22 +8373,22 @@ export type MessageContentRefusalObject = { * A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. */ export type MessageContentTextAnnotationsFileCitationObject = { - /** - * Always `file_citation`. - */ - type: 'file_citation'; - /** - * The text in the message content that needs to be replaced. + /** + * Always `file_citation`. + */ + type: 'file_citation'; + /** + * The text in the message content that needs to be replaced. + */ + text: string; + file_citation: { + /** + * The ID of the specific File the citation is from. */ - text: string; - file_citation: { - /** - * The ID of the specific File the citation is from. - */ - file_id: string; - }; - start_index: number; - end_index: number; + file_id: string; + }; + start_index: number; + end_index: number; }; /** @@ -8101,22 +8397,22 @@ export type MessageContentTextAnnotationsFileCitationObject = { * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. */ export type MessageContentTextAnnotationsFilePathObject = { - /** - * Always `file_path`. - */ - type: 'file_path'; - /** - * The text in the message content that needs to be replaced. + /** + * Always `file_path`. + */ + type: 'file_path'; + /** + * The text in the message content that needs to be replaced. + */ + text: string; + file_path: { + /** + * The ID of the file that was generated. */ - text: string; - file_path: { - /** - * The ID of the file that was generated. - */ - file_id: string; - }; - start_index: number; - end_index: number; + file_id: string; + }; + start_index: number; + end_index: number; }; /** @@ -8125,17 +8421,17 @@ export type MessageContentTextAnnotationsFilePathObject = { * The text content that is part of a message. */ export type MessageContentTextObject = { + /** + * Always `text`. + */ + type: 'text'; + text: { /** - * Always `text`. + * The data that makes up the text. */ - type: 'text'; - text: { - /** - * The data that makes up the text. - */ - value: string; - annotations: Array; - }; + value: string; + annotations: Array; + }; }; /** @@ -8144,24 +8440,24 @@ export type MessageContentTextObject = { * References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. */ export type MessageDeltaContentImageFileObject = { - /** - * The index of the content part in the message. + /** + * The index of the content part in the message. + */ + index: number; + /** + * Always `image_file`. + */ + type: 'image_file'; + image_file?: { + /** + * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. */ - index: number; + file_id?: string; /** - * Always `image_file`. + * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. */ - type: 'image_file'; - image_file?: { - /** - * The [File](https://platform.openai.com/docs/api-reference/files) ID of the image in the message content. Set `purpose="vision"` when uploading the File if you need to later display the file content. - */ - file_id?: string; - /** - * Specifies the detail level of the image if specified by the user. `low` uses fewer tokens, you can opt in to high resolution using `high`. - */ - detail?: 'auto' | 'low' | 'high'; - }; + detail?: 'auto' | 'low' | 'high'; + }; }; /** @@ -8170,24 +8466,24 @@ export type MessageDeltaContentImageFileObject = { * References an image URL in the content of a message. */ export type MessageDeltaContentImageUrlObject = { - /** - * The index of the content part in the message. + /** + * The index of the content part in the message. + */ + index: number; + /** + * Always `image_url`. + */ + type: 'image_url'; + image_url?: { + /** + * The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. */ - index: number; + url?: string; /** - * Always `image_url`. + * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. */ - type: 'image_url'; - image_url?: { - /** - * The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - */ - url?: string; - /** - * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - */ - detail?: 'auto' | 'low' | 'high'; - }; + detail?: 'auto' | 'low' | 'high'; + }; }; /** @@ -8196,15 +8492,15 @@ export type MessageDeltaContentImageUrlObject = { * The refusal content that is part of a message. */ export type MessageDeltaContentRefusalObject = { - /** - * The index of the refusal part in the message. - */ - index: number; - /** - * Always `refusal`. - */ - type: 'refusal'; - refusal?: string; + /** + * The index of the refusal part in the message. + */ + index: number; + /** + * Always `refusal`. + */ + type: 'refusal'; + refusal?: string; }; /** @@ -8213,58 +8509,58 @@ export type MessageDeltaContentRefusalObject = { * A citation within the message that points to a specific quote from a specific File associated with the assistant or the message. Generated when the assistant uses the "file_search" tool to search files. */ export type MessageDeltaContentTextAnnotationsFileCitationObject = { - /** - * The index of the annotation in the text content part. - */ - index: number; - /** - * Always `file_citation`. + /** + * The index of the annotation in the text content part. + */ + index: number; + /** + * Always `file_citation`. + */ + type: 'file_citation'; + /** + * The text in the message content that needs to be replaced. + */ + text?: string; + file_citation?: { + /** + * The ID of the specific File the citation is from. */ - type: 'file_citation'; + file_id?: string; /** - * The text in the message content that needs to be replaced. + * The specific quote in the file. */ - text?: string; - file_citation?: { - /** - * The ID of the specific File the citation is from. - */ - file_id?: string; - /** - * The specific quote in the file. - */ - quote?: string; - }; - start_index?: number; - end_index?: number; + quote?: string; + }; + start_index?: number; + end_index?: number; }; /** - * File path - * - * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. - */ -export type MessageDeltaContentTextAnnotationsFilePathObject = { - /** - * The index of the annotation in the text content part. - */ - index: number; - /** - * Always `file_path`. - */ - type: 'file_path'; - /** - * The text in the message content that needs to be replaced. + * File path + * + * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. + */ +export type MessageDeltaContentTextAnnotationsFilePathObject = { + /** + * The index of the annotation in the text content part. + */ + index: number; + /** + * Always `file_path`. + */ + type: 'file_path'; + /** + * The text in the message content that needs to be replaced. + */ + text?: string; + file_path?: { + /** + * The ID of the file that was generated. */ - text?: string; - file_path?: { - /** - * The ID of the file that was generated. - */ - file_id?: string; - }; - start_index?: number; - end_index?: number; + file_id?: string; + }; + start_index?: number; + end_index?: number; }; /** @@ -8273,21 +8569,21 @@ export type MessageDeltaContentTextAnnotationsFilePathObject = { * The text content that is part of a message. */ export type MessageDeltaContentTextObject = { - /** - * The index of the content part in the message. - */ - index: number; - /** - * Always `text`. + /** + * The index of the content part in the message. + */ + index: number; + /** + * Always `text`. + */ + type: 'text'; + text?: { + /** + * The data that makes up the text. */ - type: 'text'; - text?: { - /** - * The data that makes up the text. - */ - value?: string; - annotations?: Array; - }; + value?: string; + annotations?: Array; + }; }; /** @@ -8297,27 +8593,27 @@ export type MessageDeltaContentTextObject = { * */ export type MessageDeltaObject = { + /** + * The identifier of the message, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `thread.message.delta`. + */ + object: 'thread.message.delta'; + /** + * The delta containing the fields that have changed on the Message. + */ + delta: { /** - * The identifier of the message, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `thread.message.delta`. + * The entity that produced the message. One of `user` or `assistant`. */ - object: 'thread.message.delta'; + role?: 'user' | 'assistant'; /** - * The delta containing the fields that have changed on the Message. + * The content of the message in array of text and/or images. */ - delta: { - /** - * The entity that produced the message. One of `user` or `assistant`. - */ - role?: 'user' | 'assistant'; - /** - * The content of the message in array of text and/or images. - */ - content?: Array; - }; + content?: Array; + }; }; /** @@ -8326,73 +8622,73 @@ export type MessageDeltaObject = { * Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). */ export type MessageObject = { - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `thread.message`. - */ - object: 'thread.message'; - /** - * The Unix timestamp (in seconds) for when the message was created. - */ - created_at: number; - /** - * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. - */ - thread_id: string; - /** - * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. - */ - status: 'in_progress' | 'incomplete' | 'completed'; - /** - * On an incomplete message, details about why the message is incomplete. - */ - incomplete_details: { - /** - * The reason the message is incomplete. - */ - reason: 'content_filter' | 'max_tokens' | 'run_cancelled' | 'run_expired' | 'run_failed'; - }; - /** - * The Unix timestamp (in seconds) for when the message was completed. - */ - completed_at: number; - /** - * The Unix timestamp (in seconds) for when the message was marked as incomplete. - */ - incomplete_at: number; - /** - * The entity that produced the message. One of `user` or `assistant`. - */ - role: 'user' | 'assistant'; - /** - * The content of the message in array of text and/or images. - */ - content: Array; - /** - * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - */ - assistant_id: string; - /** - * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `thread.message`. + */ + object: 'thread.message'; + /** + * The Unix timestamp (in seconds) for when the message was created. + */ + created_at: number; + /** + * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + */ + thread_id: string; + /** + * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + */ + status: 'in_progress' | 'incomplete' | 'completed'; + /** + * On an incomplete message, details about why the message is incomplete. + */ + incomplete_details: { + /** + * The reason the message is incomplete. + */ + reason: 'content_filter' | 'max_tokens' | 'run_cancelled' | 'run_expired' | 'run_failed'; + }; + /** + * The Unix timestamp (in seconds) for when the message was completed. + */ + completed_at: number; + /** + * The Unix timestamp (in seconds) for when the message was marked as incomplete. + */ + incomplete_at: number; + /** + * The entity that produced the message. One of `user` or `assistant`. + */ + role: 'user' | 'assistant'; + /** + * The content of the message in array of text and/or images. + */ + content: Array; + /** + * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + */ + assistant_id: string; + /** + * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) associated with the creation of this message. Value is `null` when messages are created manually using the create message or create thread endpoints. + */ + run_id: string; + /** + * A list of files attached to the message, and the tools they were added to. + */ + attachments: Array<{ + /** + * The ID of the file to attach to the message. */ - run_id: string; + file_id?: string; /** - * A list of files attached to the message, and the tools they were added to. + * The tools to add this file to. */ - attachments: Array<{ - /** - * The ID of the file to attach to the message. - */ - file_id?: string; - /** - * The tools to add this file to. - */ - tools?: Array; - }>; - metadata: Metadata; + tools?: Array; + }>; + metadata: Metadata; }; /** @@ -8401,32 +8697,37 @@ export type MessageObject = { * The text content that is part of a message. */ export type MessageRequestContentTextObject = { - /** - * Always `text`. - */ - type: 'text'; - /** - * Text content to be sent to the model - */ - text: string; -}; - -export type MessageStreamEvent = { - event: 'thread.message.created'; - data: MessageObject; -} | { - event: 'thread.message.in_progress'; - data: MessageObject; -} | { - event: 'thread.message.delta'; - data: MessageDeltaObject; -} | { - event: 'thread.message.completed'; - data: MessageObject; -} | { - event: 'thread.message.incomplete'; - data: MessageObject; -}; + /** + * Always `text`. + */ + type: 'text'; + /** + * Text content to be sent to the model + */ + text: string; +}; + +export type MessageStreamEvent = + | { + event: 'thread.message.created'; + data: MessageObject; + } + | { + event: 'thread.message.in_progress'; + data: MessageObject; + } + | { + event: 'thread.message.delta'; + data: MessageDeltaObject; + } + | { + event: 'thread.message.completed'; + data: MessageObject; + } + | { + event: 'thread.message.incomplete'; + data: MessageObject; + }; /** * Set of 16 key-value pairs that can be attached to an object. This can be @@ -8438,7 +8739,7 @@ export type MessageStreamEvent = { * */ export type Metadata = { - [key: string]: string; + [key: string]: string; }; /** @@ -8447,177 +8748,188 @@ export type Metadata = { * Describes an OpenAI model offering that can be used with the API. */ export type Model = { - /** - * The model identifier, which can be referenced in the API endpoints. - */ - id: string; - /** - * The Unix timestamp (in seconds) when the model was created. - */ - created: number; - /** - * The object type, which is always "model". - */ - object: 'model'; - /** - * The organization that owns the model. - */ - owned_by: string; + /** + * The model identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) when the model was created. + */ + created: number; + /** + * The object type, which is always "model". + */ + object: 'model'; + /** + * The organization that owns the model. + */ + owned_by: string; }; export type ModelIds = ModelIdsShared | ModelIdsResponses; -export type ModelIdsResponses = ModelIdsShared | 'o1-pro' | 'o1-pro-2025-03-19' | 'o3-pro' | 'o3-pro-2025-06-10' | 'o3-deep-research' | 'o3-deep-research-2025-06-26' | 'o4-mini-deep-research' | 'o4-mini-deep-research-2025-06-26' | 'computer-use-preview' | 'computer-use-preview-2025-03-11'; +export type ModelIdsResponses = + | ModelIdsShared + | 'o1-pro' + | 'o1-pro-2025-03-19' + | 'o3-pro' + | 'o3-pro-2025-06-10' + | 'o3-deep-research' + | 'o3-deep-research-2025-06-26' + | 'o4-mini-deep-research' + | 'o4-mini-deep-research-2025-06-26' + | 'computer-use-preview' + | 'computer-use-preview-2025-03-11'; export type ModelIdsShared = string | ChatModel; export type ModelResponseProperties = { - metadata?: Metadata; - /** - * An integer between 0 and 20 specifying the number of most likely tokens to - * return at each token position, each with an associated log probability. - * - */ - top_logprobs?: number; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * We generally recommend altering this or `top_p` but not both. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, - * where the model considers the results of the tokens with top_p probability - * mass. So 0.1 means only the tokens comprising the top 10% probability mass - * are considered. - * - * We generally recommend altering this or `temperature` but not both. - * - */ - top_p?: number; - /** - * This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. - * A stable identifier for your end-users. - * Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - * - * @deprecated - */ - user?: string; - /** - * A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. - * The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). - * - */ - safety_identifier?: string; - /** - * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). - * - */ - prompt_cache_key?: string; - service_tier?: ServiceTier; + metadata?: Metadata; + /** + * An integer between 0 and 20 specifying the number of most likely tokens to + * return at each token position, each with an associated log probability. + * + */ + top_logprobs?: number; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * We generally recommend altering this or `top_p` but not both. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, + * where the model considers the results of the tokens with top_p probability + * mass. So 0.1 means only the tokens comprising the top 10% probability mass + * are considered. + * + * We generally recommend altering this or `temperature` but not both. + * + */ + top_p?: number; + /** + * This field is being replaced by `safety_identifier` and `prompt_cache_key`. Use `prompt_cache_key` instead to maintain caching optimizations. + * A stable identifier for your end-users. + * Used to boost cache hit rates by better bucketing similar requests and to help OpenAI detect and prevent abuse. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + * + * @deprecated + */ + user?: string; + /** + * A stable identifier used to help detect users of your application that may be violating OpenAI's usage policies. + * The IDs should be a string that uniquely identifies each user. We recommend hashing their username or email address, in order to avoid sending us any identifying information. [Learn more](https://platform.openai.com/docs/guides/safety-best-practices#safety-identifiers). + * + */ + safety_identifier?: string; + /** + * Used by OpenAI to cache responses for similar requests to optimize your cache hit rates. Replaces the `user` field. [Learn more](https://platform.openai.com/docs/guides/prompt-caching). + * + */ + prompt_cache_key?: string; + service_tier?: ServiceTier; }; export type ModifyAssistantRequest = { - /** - * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. - * - */ - model?: string | AssistantSupportedModels; - reasoning_effort?: ReasoningEffort; - /** - * The name of the assistant. The maximum length is 256 characters. - * - */ - name?: string; - /** - * The description of the assistant. The maximum length is 512 characters. - * - */ - description?: string; - /** - * The system instructions that the assistant uses. The maximum length is 256,000 characters. - * - */ - instructions?: string; - /** - * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. - * - */ - tools?: Array; - /** - * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources?: { - code_interpreter?: { - /** - * Overrides the list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: { - /** - * Overrides the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - * - */ - vector_store_ids?: Array; - }; + /** + * ID of the model to use. You can use the [List models](https://platform.openai.com/docs/api-reference/models/list) API to see all of your available models, or see our [Model overview](https://platform.openai.com/docs/models) for descriptions of them. + * + */ + model?: string | AssistantSupportedModels; + reasoning_effort?: ReasoningEffort; + /** + * The name of the assistant. The maximum length is 256 characters. + * + */ + name?: string; + /** + * The description of the assistant. The maximum length is 512 characters. + * + */ + description?: string; + /** + * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * + */ + instructions?: string; + /** + * A list of tool enabled on the assistant. There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`. + * + */ + tools?: Array; + /** + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * Overrides the list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; }; - metadata?: Metadata; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * - */ - top_p?: number; - response_format?: AssistantsApiResponseFormatOption; + file_search?: { + /** + * Overrides the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + * + */ + vector_store_ids?: Array; + }; + }; + metadata?: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + response_format?: AssistantsApiResponseFormatOption; }; export type ModifyCertificateRequest = { - /** - * The updated name for the certificate - */ - name: string; + /** + * The updated name for the certificate + */ + name: string; }; export type ModifyMessageRequest = { - metadata?: Metadata; + metadata?: Metadata; }; export type ModifyRunRequest = { - metadata?: Metadata; + metadata?: Metadata; }; export type ModifyThreadRequest = { - /** - * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources?: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: { - /** - * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - * - */ - vector_store_ids?: Array; - }; + /** + * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; }; - metadata?: Metadata; + file_search?: { + /** + * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + * + */ + vector_store_ids?: Array; + }; + }; + metadata?: Metadata; }; /** @@ -8627,22 +8939,22 @@ export type ModifyThreadRequest = { * */ export type Move = { - /** - * Specifies the event type. For a move action, this property is - * always set to `move`. - * - */ - type: 'move'; - /** - * The x-coordinate to move to. - * - */ - x: number; - /** - * The y-coordinate to move to. - * - */ - y: number; + /** + * Specifies the event type. For a move action, this property is + * always set to `move`. + * + */ + type: 'move'; + /** + * The x-coordinate to move to. + * + */ + x: number; + /** + * The y-coordinate to move to. + * + */ + y: number; }; /** @@ -8651,46 +8963,54 @@ export type Move = { * The `File` object represents a document that has been uploaded to OpenAI. */ export type OpenAiFile = { - /** - * The file identifier, which can be referenced in the API endpoints. - */ - id: string; - /** - * The size of the file, in bytes. - */ - bytes: number; - /** - * The Unix timestamp (in seconds) for when the file was created. - */ - created_at: number; - /** - * The Unix timestamp (in seconds) for when the file will expire. - */ - expires_at?: number; - /** - * The name of the file. - */ - filename: string; - /** - * The object type, which is always `file`. - */ - object: 'file'; - /** - * The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`. - */ - purpose: 'assistants' | 'assistants_output' | 'batch' | 'batch_output' | 'fine-tune' | 'fine-tune-results' | 'vision' | 'user_data'; - /** - * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. - * - * @deprecated - */ - status: 'uploaded' | 'processed' | 'error'; - /** - * Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. - * - * @deprecated - */ - status_details?: string; + /** + * The file identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * The size of the file, in bytes. + */ + bytes: number; + /** + * The Unix timestamp (in seconds) for when the file was created. + */ + created_at: number; + /** + * The Unix timestamp (in seconds) for when the file will expire. + */ + expires_at?: number; + /** + * The name of the file. + */ + filename: string; + /** + * The object type, which is always `file`. + */ + object: 'file'; + /** + * The intended purpose of the file. Supported values are `assistants`, `assistants_output`, `batch`, `batch_output`, `fine-tune`, `fine-tune-results`, `vision`, and `user_data`. + */ + purpose: + | 'assistants' + | 'assistants_output' + | 'batch' + | 'batch_output' + | 'fine-tune' + | 'fine-tune-results' + | 'vision' + | 'user_data'; + /** + * Deprecated. The current status of the file, which can be either `uploaded`, `processed`, or `error`. + * + * @deprecated + */ + status: 'uploaded' | 'processed' | 'error'; + /** + * Deprecated. For details on why a fine-tuning training file failed validation, see the `error` field on `fine_tuning.job`. + * + * @deprecated + */ + status_details?: string; }; /** @@ -8699,10 +9019,10 @@ export type OpenAiFile = { * This is returned when the chunking strategy is unknown. Typically, this is because the file was indexed before the `chunking_strategy` concept was introduced in the API. */ export type OtherChunkingStrategyResponseParam = { - /** - * Always `other`. - */ - type: 'other'; + /** + * Always `other`. + */ + type: 'other'; }; /** @@ -8712,56 +9032,71 @@ export type OtherChunkingStrategyResponseParam = { * */ export type OutputAudio = { - /** - * The type of the output audio. Always `output_audio`. - * - */ - type: 'output_audio'; - /** - * Base64-encoded audio data from the model. - * - */ - data: string; - /** - * The transcript of the audio data from the model. - * - */ - transcript: string; -}; - -export type OutputContent = ({ - type?: 'OutputTextContent'; -} & OutputTextContent) | ({ - type?: 'RefusalContent'; -} & RefusalContent); - -export type OutputItem = ({ - type?: 'OutputMessage'; -} & OutputMessage) | ({ - type?: 'FileSearchToolCall'; -} & FileSearchToolCall) | ({ - type?: 'FunctionToolCall'; -} & FunctionToolCall) | ({ - type?: 'WebSearchToolCall'; -} & WebSearchToolCall) | ({ - type?: 'ComputerToolCall'; -} & ComputerToolCall) | ({ - type?: 'ReasoningItem'; -} & ReasoningItem) | ({ - type?: 'ImageGenToolCall'; -} & ImageGenToolCall) | ({ - type?: 'CodeInterpreterToolCall'; -} & CodeInterpreterToolCall) | ({ - type?: 'LocalShellToolCall'; -} & LocalShellToolCall) | ({ - type?: 'MCPToolCall'; -} & McpToolCall) | ({ - type?: 'MCPListTools'; -} & McpListTools) | ({ - type?: 'MCPApprovalRequest'; -} & McpApprovalRequest) | ({ - type?: 'CustomToolCall'; -} & CustomToolCall); + /** + * The type of the output audio. Always `output_audio`. + * + */ + type: 'output_audio'; + /** + * Base64-encoded audio data from the model. + * + */ + data: string; + /** + * The transcript of the audio data from the model. + * + */ + transcript: string; +}; + +export type OutputContent = + | ({ + type?: 'OutputTextContent'; + } & OutputTextContent) + | ({ + type?: 'RefusalContent'; + } & RefusalContent); + +export type OutputItem = + | ({ + type?: 'OutputMessage'; + } & OutputMessage) + | ({ + type?: 'FileSearchToolCall'; + } & FileSearchToolCall) + | ({ + type?: 'FunctionToolCall'; + } & FunctionToolCall) + | ({ + type?: 'WebSearchToolCall'; + } & WebSearchToolCall) + | ({ + type?: 'ComputerToolCall'; + } & ComputerToolCall) + | ({ + type?: 'ReasoningItem'; + } & ReasoningItem) + | ({ + type?: 'ImageGenToolCall'; + } & ImageGenToolCall) + | ({ + type?: 'CodeInterpreterToolCall'; + } & CodeInterpreterToolCall) + | ({ + type?: 'LocalShellToolCall'; + } & LocalShellToolCall) + | ({ + type?: 'MCPToolCall'; + } & McpToolCall) + | ({ + type?: 'MCPListTools'; + } & McpListTools) + | ({ + type?: 'MCPApprovalRequest'; + } & McpApprovalRequest) + | ({ + type?: 'CustomToolCall'; + } & CustomToolCall); /** * Output message @@ -8770,32 +9105,32 @@ export type OutputItem = ({ * */ export type OutputMessage = { - /** - * The unique ID of the output message. - * - */ - id: string; - /** - * The type of the output message. Always `message`. - * - */ - type: 'message'; - /** - * The role of the output message. Always `assistant`. - * - */ - role: 'assistant'; - /** - * The content of the output message. - * - */ - content: Array; - /** - * The status of the message input. One of `in_progress`, `completed`, or - * `incomplete`. Populated when input items are returned via API. - * - */ - status: 'in_progress' | 'completed' | 'incomplete'; + /** + * The unique ID of the output message. + * + */ + id: string; + /** + * The type of the output message. Always `message`. + * + */ + type: 'message'; + /** + * The role of the output message. Always `assistant`. + * + */ + role: 'assistant'; + /** + * The content of the output message. + * + */ + content: Array; + /** + * The status of the message input. One of `in_progress`, `completed`, or + * `incomplete`. Populated when input items are returned via API. + * + */ + status: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -8822,332 +9157,332 @@ export type PartialImages = number; * */ export type PredictionContent = { - /** - * The type of the predicted content you want to provide. This type is - * currently always `content`. - * - */ - type: 'content'; - /** - * The content that should be matched when generating a model response. - * If generated tokens would match this content, the entire model response - * can be returned much more quickly. - * - */ - content: string | Array; + /** + * The type of the predicted content you want to provide. This type is + * currently always `content`. + * + */ + type: 'content'; + /** + * The content that should be matched when generating a model response. + * If generated tokens would match this content, the entire model response + * can be returned much more quickly. + * + */ + content: string | Array; }; /** * Represents an individual project. */ -export type Project = { - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - /** - * The object type, which is always `organization.project` - */ - object: 'organization.project'; - /** - * The name of the project. This appears in reporting. - */ - name: string; - /** - * The Unix timestamp (in seconds) of when the project was created. - */ - created_at: number; - /** - * The Unix timestamp (in seconds) of when the project was archived or `null`. - */ - archived_at?: number; - /** - * `active` or `archived` - */ - status: 'active' | 'archived'; +export type Project = { + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The object type, which is always `organization.project` + */ + object: 'organization.project'; + /** + * The name of the project. This appears in reporting. + */ + name: string; + /** + * The Unix timestamp (in seconds) of when the project was created. + */ + created_at: number; + /** + * The Unix timestamp (in seconds) of when the project was archived or `null`. + */ + archived_at?: number; + /** + * `active` or `archived` + */ + status: 'active' | 'archived'; }; /** * Represents an individual API key in a project. */ export type ProjectApiKey = { - /** - * The object type, which is always `organization.project.api_key` - */ - object: 'organization.project.api_key'; - /** - * The redacted value of the API key - */ - redacted_value: string; - /** - * The name of the API key - */ - name: string; - /** - * The Unix timestamp (in seconds) of when the API key was created - */ - created_at: number; - /** - * The Unix timestamp (in seconds) of when the API key was last used. + /** + * The object type, which is always `organization.project.api_key` + */ + object: 'organization.project.api_key'; + /** + * The redacted value of the API key + */ + redacted_value: string; + /** + * The name of the API key + */ + name: string; + /** + * The Unix timestamp (in seconds) of when the API key was created + */ + created_at: number; + /** + * The Unix timestamp (in seconds) of when the API key was last used. + */ + last_used_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + owner: { + /** + * `user` or `service_account` */ - last_used_at: number; - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - owner: { - /** - * `user` or `service_account` - */ - type?: 'user' | 'service_account'; - user?: ProjectUser; - service_account?: ProjectServiceAccount; - }; + type?: 'user' | 'service_account'; + user?: ProjectUser; + service_account?: ProjectServiceAccount; + }; }; export type ProjectApiKeyDeleteResponse = { - object: 'organization.project.api_key.deleted'; - id: string; - deleted: boolean; + object: 'organization.project.api_key.deleted'; + id: string; + deleted: boolean; }; export type ProjectApiKeyListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: 'list'; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ProjectCreateRequest = { - /** - * The friendly name of the project, this name appears in reports. - */ - name: string; + /** + * The friendly name of the project, this name appears in reports. + */ + name: string; }; export type ProjectListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: 'list'; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; /** * Represents a project rate limit config. */ export type ProjectRateLimit = { - /** - * The object type, which is always `project.rate_limit` - */ - object: 'project.rate_limit'; - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The model this rate limit applies to. - */ - model: string; - /** - * The maximum requests per minute. - */ - max_requests_per_1_minute: number; - /** - * The maximum tokens per minute. - */ - max_tokens_per_1_minute: number; - /** - * The maximum images per minute. Only present for relevant models. - */ - max_images_per_1_minute?: number; - /** - * The maximum audio megabytes per minute. Only present for relevant models. - */ - max_audio_megabytes_per_1_minute?: number; - /** - * The maximum requests per day. Only present for relevant models. - */ - max_requests_per_1_day?: number; - /** - * The maximum batch input tokens per day. Only present for relevant models. - */ - batch_1_day_max_input_tokens?: number; + /** + * The object type, which is always `project.rate_limit` + */ + object: 'project.rate_limit'; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The model this rate limit applies to. + */ + model: string; + /** + * The maximum requests per minute. + */ + max_requests_per_1_minute: number; + /** + * The maximum tokens per minute. + */ + max_tokens_per_1_minute: number; + /** + * The maximum images per minute. Only present for relevant models. + */ + max_images_per_1_minute?: number; + /** + * The maximum audio megabytes per minute. Only present for relevant models. + */ + max_audio_megabytes_per_1_minute?: number; + /** + * The maximum requests per day. Only present for relevant models. + */ + max_requests_per_1_day?: number; + /** + * The maximum batch input tokens per day. Only present for relevant models. + */ + batch_1_day_max_input_tokens?: number; }; export type ProjectRateLimitListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: 'list'; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ProjectRateLimitUpdateRequest = { - /** - * The maximum requests per minute. - */ - max_requests_per_1_minute?: number; - /** - * The maximum tokens per minute. - */ - max_tokens_per_1_minute?: number; - /** - * The maximum images per minute. Only relevant for certain models. - */ - max_images_per_1_minute?: number; - /** - * The maximum audio megabytes per minute. Only relevant for certain models. - */ - max_audio_megabytes_per_1_minute?: number; - /** - * The maximum requests per day. Only relevant for certain models. - */ - max_requests_per_1_day?: number; - /** - * The maximum batch input tokens per day. Only relevant for certain models. - */ - batch_1_day_max_input_tokens?: number; + /** + * The maximum requests per minute. + */ + max_requests_per_1_minute?: number; + /** + * The maximum tokens per minute. + */ + max_tokens_per_1_minute?: number; + /** + * The maximum images per minute. Only relevant for certain models. + */ + max_images_per_1_minute?: number; + /** + * The maximum audio megabytes per minute. Only relevant for certain models. + */ + max_audio_megabytes_per_1_minute?: number; + /** + * The maximum requests per day. Only relevant for certain models. + */ + max_requests_per_1_day?: number; + /** + * The maximum batch input tokens per day. Only relevant for certain models. + */ + batch_1_day_max_input_tokens?: number; }; /** * Represents an individual service account in a project. */ export type ProjectServiceAccount = { - /** - * The object type, which is always `organization.project.service_account` - */ - object: 'organization.project.service_account'; - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - /** - * The name of the service account - */ - name: string; - /** - * `owner` or `member` - */ - role: 'owner' | 'member'; - /** - * The Unix timestamp (in seconds) of when the service account was created - */ - created_at: number; + /** + * The object type, which is always `organization.project.service_account` + */ + object: 'organization.project.service_account'; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the service account + */ + name: string; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; + /** + * The Unix timestamp (in seconds) of when the service account was created + */ + created_at: number; }; export type ProjectServiceAccountApiKey = { - /** - * The object type, which is always `organization.project.service_account.api_key` - */ - object: 'organization.project.service_account.api_key'; - value: string; - name: string; - created_at: number; - id: string; + /** + * The object type, which is always `organization.project.service_account.api_key` + */ + object: 'organization.project.service_account.api_key'; + value: string; + name: string; + created_at: number; + id: string; }; export type ProjectServiceAccountCreateRequest = { - /** - * The name of the service account being created. - */ - name: string; + /** + * The name of the service account being created. + */ + name: string; }; export type ProjectServiceAccountCreateResponse = { - object: 'organization.project.service_account'; - id: string; - name: string; - /** - * Service accounts can only have one role of type `member` - */ - role: 'member'; - created_at: number; - api_key: ProjectServiceAccountApiKey; + object: 'organization.project.service_account'; + id: string; + name: string; + /** + * Service accounts can only have one role of type `member` + */ + role: 'member'; + created_at: number; + api_key: ProjectServiceAccountApiKey; }; export type ProjectServiceAccountDeleteResponse = { - object: 'organization.project.service_account.deleted'; - id: string; - deleted: boolean; + object: 'organization.project.service_account.deleted'; + id: string; + deleted: boolean; }; export type ProjectServiceAccountListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: 'list'; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ProjectUpdateRequest = { - /** - * The updated name of the project, this name appears in reports. - */ - name: string; + /** + * The updated name of the project, this name appears in reports. + */ + name: string; }; /** * Represents an individual user in a project. */ export type ProjectUser = { - /** - * The object type, which is always `organization.project.user` - */ - object: 'organization.project.user'; - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - /** - * The name of the user - */ - name: string; - /** - * The email address of the user - */ - email: string; - /** - * `owner` or `member` - */ - role: 'owner' | 'member'; - /** - * The Unix timestamp (in seconds) of when the project was added. - */ - added_at: number; + /** + * The object type, which is always `organization.project.user` + */ + object: 'organization.project.user'; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the user + */ + name: string; + /** + * The email address of the user + */ + email: string; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; + /** + * The Unix timestamp (in seconds) of when the project was added. + */ + added_at: number; }; export type ProjectUserCreateRequest = { - /** - * The ID of the user. - */ - user_id: string; - /** - * `owner` or `member` - */ - role: 'owner' | 'member'; + /** + * The ID of the user. + */ + user_id: string; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; }; export type ProjectUserDeleteResponse = { - object: 'organization.project.user.deleted'; - id: string; - deleted: boolean; + object: 'organization.project.user.deleted'; + id: string; + deleted: boolean; }; export type ProjectUserListResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: string; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type ProjectUserUpdateRequest = { - /** - * `owner` or `member` - */ - role: 'owner' | 'member'; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; }; /** @@ -9156,46 +9491,58 @@ export type ProjectUserUpdateRequest = { * */ export type Prompt = { - /** - * The unique identifier of the prompt template to use. - */ - id: string; - /** - * Optional version of the prompt template. - */ - version?: string; - variables?: ResponsePromptVariables; + /** + * The unique identifier of the prompt template to use. + */ + id: string; + /** + * Optional version of the prompt template. + */ + version?: string; + variables?: ResponsePromptVariables; }; /** * A realtime client event. * */ -export type RealtimeClientEvent = ({ - type?: 'RealtimeClientEventConversationItemCreate'; -} & RealtimeClientEventConversationItemCreate) | ({ - type?: 'RealtimeClientEventConversationItemDelete'; -} & RealtimeClientEventConversationItemDelete) | ({ - type?: 'RealtimeClientEventConversationItemRetrieve'; -} & RealtimeClientEventConversationItemRetrieve) | ({ - type?: 'RealtimeClientEventConversationItemTruncate'; -} & RealtimeClientEventConversationItemTruncate) | ({ - type?: 'RealtimeClientEventInputAudioBufferAppend'; -} & RealtimeClientEventInputAudioBufferAppend) | ({ - type?: 'RealtimeClientEventInputAudioBufferClear'; -} & RealtimeClientEventInputAudioBufferClear) | ({ - type?: 'RealtimeClientEventOutputAudioBufferClear'; -} & RealtimeClientEventOutputAudioBufferClear) | ({ - type?: 'RealtimeClientEventInputAudioBufferCommit'; -} & RealtimeClientEventInputAudioBufferCommit) | ({ - type?: 'RealtimeClientEventResponseCancel'; -} & RealtimeClientEventResponseCancel) | ({ - type?: 'RealtimeClientEventResponseCreate'; -} & RealtimeClientEventResponseCreate) | ({ - type?: 'RealtimeClientEventSessionUpdate'; -} & RealtimeClientEventSessionUpdate) | ({ - type?: 'RealtimeClientEventTranscriptionSessionUpdate'; -} & RealtimeClientEventTranscriptionSessionUpdate); +export type RealtimeClientEvent = + | ({ + type?: 'RealtimeClientEventConversationItemCreate'; + } & RealtimeClientEventConversationItemCreate) + | ({ + type?: 'RealtimeClientEventConversationItemDelete'; + } & RealtimeClientEventConversationItemDelete) + | ({ + type?: 'RealtimeClientEventConversationItemRetrieve'; + } & RealtimeClientEventConversationItemRetrieve) + | ({ + type?: 'RealtimeClientEventConversationItemTruncate'; + } & RealtimeClientEventConversationItemTruncate) + | ({ + type?: 'RealtimeClientEventInputAudioBufferAppend'; + } & RealtimeClientEventInputAudioBufferAppend) + | ({ + type?: 'RealtimeClientEventInputAudioBufferClear'; + } & RealtimeClientEventInputAudioBufferClear) + | ({ + type?: 'RealtimeClientEventOutputAudioBufferClear'; + } & RealtimeClientEventOutputAudioBufferClear) + | ({ + type?: 'RealtimeClientEventInputAudioBufferCommit'; + } & RealtimeClientEventInputAudioBufferCommit) + | ({ + type?: 'RealtimeClientEventResponseCancel'; + } & RealtimeClientEventResponseCancel) + | ({ + type?: 'RealtimeClientEventResponseCreate'; + } & RealtimeClientEventResponseCreate) + | ({ + type?: 'RealtimeClientEventSessionUpdate'; + } & RealtimeClientEventSessionUpdate) + | ({ + type?: 'RealtimeClientEventTranscriptionSessionUpdate'; + } & RealtimeClientEventTranscriptionSessionUpdate); /** * Add a new Item to the Conversation's context, including messages, function @@ -9208,24 +9555,24 @@ export type RealtimeClientEvent = ({ * */ export type RealtimeClientEventConversationItemCreate = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `conversation.item.create`. - */ - type: 'conversation.item.create'; - /** - * The ID of the preceding item after which the new item will be inserted. - * If not set, the new item will be appended to the end of the conversation. - * If set to `root`, the new item will be added to the beginning of the conversation. - * If set to an existing ID, it allows an item to be inserted mid-conversation. If the - * ID cannot be found, an error will be returned and the item will not be added. - * - */ - previous_item_id?: string; - item: RealtimeConversationItem; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `conversation.item.create`. + */ + type: 'conversation.item.create'; + /** + * The ID of the preceding item after which the new item will be inserted. + * If not set, the new item will be appended to the end of the conversation. + * If set to `root`, the new item will be added to the beginning of the conversation. + * If set to an existing ID, it allows an item to be inserted mid-conversation. If the + * ID cannot be found, an error will be returned and the item will not be added. + * + */ + previous_item_id?: string; + item: RealtimeConversationItem; }; /** @@ -9236,18 +9583,18 @@ export type RealtimeClientEventConversationItemCreate = { * */ export type RealtimeClientEventConversationItemDelete = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `conversation.item.delete`. - */ - type: 'conversation.item.delete'; - /** - * The ID of the item to delete. - */ - item_id: string; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `conversation.item.delete`. + */ + type: 'conversation.item.delete'; + /** + * The ID of the item to delete. + */ + item_id: string; }; /** @@ -9258,18 +9605,18 @@ export type RealtimeClientEventConversationItemDelete = { * */ export type RealtimeClientEventConversationItemRetrieve = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `conversation.item.retrieve`. - */ - type: 'conversation.item.retrieve'; - /** - * The ID of the item to retrieve. - */ - item_id: string; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `conversation.item.retrieve`. + */ + type: 'conversation.item.retrieve'; + /** + * The ID of the item to retrieve. + */ + item_id: string; }; /** @@ -9287,31 +9634,31 @@ export type RealtimeClientEventConversationItemRetrieve = { * */ export type RealtimeClientEventConversationItemTruncate = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `conversation.item.truncate`. - */ - type: 'conversation.item.truncate'; - /** - * The ID of the assistant message item to truncate. Only assistant message - * items can be truncated. - * - */ - item_id: string; - /** - * The index of the content part to truncate. Set this to 0. - */ - content_index: number; - /** - * Inclusive duration up to which audio is truncated, in milliseconds. If - * the audio_end_ms is greater than the actual audio duration, the server - * will respond with an error. - * - */ - audio_end_ms: number; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `conversation.item.truncate`. + */ + type: 'conversation.item.truncate'; + /** + * The ID of the assistant message item to truncate. Only assistant message + * items can be truncated. + * + */ + item_id: string; + /** + * The index of the content part to truncate. Set this to 0. + */ + content_index: number; + /** + * Inclusive duration up to which audio is truncated, in milliseconds. If + * the audio_end_ms is greater than the actual audio duration, the server + * will respond with an error. + * + */ + audio_end_ms: number; }; /** @@ -9328,20 +9675,20 @@ export type RealtimeClientEventConversationItemTruncate = { * */ export type RealtimeClientEventInputAudioBufferAppend = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `input_audio_buffer.append`. - */ - type: 'input_audio_buffer.append'; - /** - * Base64-encoded audio bytes. This must be in the format specified by the - * `input_audio_format` field in the session configuration. - * - */ - audio: string; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `input_audio_buffer.append`. + */ + type: 'input_audio_buffer.append'; + /** + * Base64-encoded audio bytes. This must be in the format specified by the + * `input_audio_format` field in the session configuration. + * + */ + audio: string; }; /** @@ -9350,14 +9697,14 @@ export type RealtimeClientEventInputAudioBufferAppend = { * */ export type RealtimeClientEventInputAudioBufferClear = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `input_audio_buffer.clear`. - */ - type: 'input_audio_buffer.clear'; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `input_audio_buffer.clear`. + */ + type: 'input_audio_buffer.clear'; }; /** @@ -9374,14 +9721,14 @@ export type RealtimeClientEventInputAudioBufferClear = { * */ export type RealtimeClientEventInputAudioBufferCommit = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `input_audio_buffer.commit`. - */ - type: 'input_audio_buffer.commit'; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `input_audio_buffer.commit`. + */ + type: 'input_audio_buffer.commit'; }; /** @@ -9393,14 +9740,14 @@ export type RealtimeClientEventInputAudioBufferCommit = { * */ export type RealtimeClientEventOutputAudioBufferClear = { - /** - * The unique ID of the client event used for error handling. - */ - event_id?: string; - /** - * The event type, must be `output_audio_buffer.clear`. - */ - type: 'output_audio_buffer.clear'; + /** + * The unique ID of the client event used for error handling. + */ + event_id?: string; + /** + * The event type, must be `output_audio_buffer.clear`. + */ + type: 'output_audio_buffer.clear'; }; /** @@ -9410,20 +9757,20 @@ export type RealtimeClientEventOutputAudioBufferClear = { * */ export type RealtimeClientEventResponseCancel = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `response.cancel`. - */ - type: 'response.cancel'; - /** - * A specific response ID to cancel - if not provided, will cancel an - * in-progress response in the default conversation. - * - */ - response_id?: string; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `response.cancel`. + */ + type: 'response.cancel'; + /** + * A specific response ID to cancel - if not provided, will cancel an + * in-progress response in the default conversation. + * + */ + response_id?: string; }; /** @@ -9445,15 +9792,15 @@ export type RealtimeClientEventResponseCancel = { * */ export type RealtimeClientEventResponseCreate = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `response.create`. - */ - type: 'response.create'; - response?: RealtimeResponseCreateParams; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `response.create`. + */ + type: 'response.create'; + response?: RealtimeResponseCreateParams; }; /** @@ -9464,569 +9811,603 @@ export type RealtimeClientEventResponseCreate = { * another model using `session.update`. * * When the server receives a `session.update`, it will respond - * with a `session.updated` event showing the full, effective configuration. - * Only the fields that are present are updated. To clear a field like - * `instructions`, pass an empty string. - * - */ -export type RealtimeClientEventSessionUpdate = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `session.update`. - */ - type: 'session.update'; - session: RealtimeSessionCreateRequest; -}; - -/** - * Send this event to update a transcription session. - * - */ -export type RealtimeClientEventTranscriptionSessionUpdate = { - /** - * Optional client-generated ID used to identify this event. - */ - event_id?: string; - /** - * The event type, must be `transcription_session.update`. - */ - type: 'transcription_session.update'; - session: RealtimeTranscriptionSessionCreateRequest; -}; - -/** - * The item to add to the conversation. - */ -export type RealtimeConversationItem = { - /** - * The unique ID of the item, this can be generated by the client to help - * manage server-side context, but is not required because the server will - * generate one if not provided. - * - */ - id?: string; - /** - * The type of the item (`message`, `function_call`, `function_call_output`). - * - */ - type?: 'message' | 'function_call' | 'function_call_output'; - /** - * Identifier for the API object being returned - always `realtime.item`. - * - */ - object?: 'realtime.item'; - /** - * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect - * on the conversation, but are accepted for consistency with the - * `conversation.item.created` event. - * - */ - status?: 'completed' | 'incomplete' | 'in_progress'; - /** - * The role of the message sender (`user`, `assistant`, `system`), only - * applicable for `message` items. - * - */ - role?: 'user' | 'assistant' | 'system'; - /** - * The content of the message, applicable for `message` items. - * - Message items of role `system` support only `input_text` content - * - Message items of role `user` support `input_text` and `input_audio` - * content - * - Message items of role `assistant` support `text` content. - * - */ - content?: Array; - /** - * The ID of the function call (for `function_call` and - * `function_call_output` items). If passed on a `function_call_output` - * item, the server will check that a `function_call` item with the same - * ID exists in the conversation history. - * - */ - call_id?: string; - /** - * The name of the function being called (for `function_call` items). - * - */ - name?: string; - /** - * The arguments of the function call (for `function_call` items). - * - */ - arguments?: string; - /** - * The output of the function call (for `function_call_output` items). - * - */ - output?: string; + * with a `session.updated` event showing the full, effective configuration. + * Only the fields that are present are updated. To clear a field like + * `instructions`, pass an empty string. + * + */ +export type RealtimeClientEventSessionUpdate = { + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `session.update`. + */ + type: 'session.update'; + session: RealtimeSessionCreateRequest; +}; + +/** + * Send this event to update a transcription session. + * + */ +export type RealtimeClientEventTranscriptionSessionUpdate = { + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The event type, must be `transcription_session.update`. + */ + type: 'transcription_session.update'; + session: RealtimeTranscriptionSessionCreateRequest; +}; + +/** + * The item to add to the conversation. + */ +export type RealtimeConversationItem = { + /** + * The unique ID of the item, this can be generated by the client to help + * manage server-side context, but is not required because the server will + * generate one if not provided. + * + */ + id?: string; + /** + * The type of the item (`message`, `function_call`, `function_call_output`). + * + */ + type?: 'message' | 'function_call' | 'function_call_output'; + /** + * Identifier for the API object being returned - always `realtime.item`. + * + */ + object?: 'realtime.item'; + /** + * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect + * on the conversation, but are accepted for consistency with the + * `conversation.item.created` event. + * + */ + status?: 'completed' | 'incomplete' | 'in_progress'; + /** + * The role of the message sender (`user`, `assistant`, `system`), only + * applicable for `message` items. + * + */ + role?: 'user' | 'assistant' | 'system'; + /** + * The content of the message, applicable for `message` items. + * - Message items of role `system` support only `input_text` content + * - Message items of role `user` support `input_text` and `input_audio` + * content + * - Message items of role `assistant` support `text` content. + * + */ + content?: Array; + /** + * The ID of the function call (for `function_call` and + * `function_call_output` items). If passed on a `function_call_output` + * item, the server will check that a `function_call` item with the same + * ID exists in the conversation history. + * + */ + call_id?: string; + /** + * The name of the function being called (for `function_call` items). + * + */ + name?: string; + /** + * The arguments of the function call (for `function_call` items). + * + */ + arguments?: string; + /** + * The output of the function call (for `function_call_output` items). + * + */ + output?: string; }; /** * The item to add to the conversation. */ export type RealtimeConversationItemWithReference = { + /** + * For an item of type (`message` | `function_call` | `function_call_output`) + * this field allows the client to assign the unique ID of the item. It is + * not required because the server will generate one if not provided. + * + * For an item of type `item_reference`, this field is required and is a + * reference to any item that has previously existed in the conversation. + * + */ + id?: string; + /** + * The type of the item (`message`, `function_call`, `function_call_output`, `item_reference`). + * + */ + type?: 'message' | 'function_call' | 'function_call_output' | 'item_reference'; + /** + * Identifier for the API object being returned - always `realtime.item`. + * + */ + object?: 'realtime.item'; + /** + * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect + * on the conversation, but are accepted for consistency with the + * `conversation.item.created` event. + * + */ + status?: 'completed' | 'incomplete' | 'in_progress'; + /** + * The role of the message sender (`user`, `assistant`, `system`), only + * applicable for `message` items. + * + */ + role?: 'user' | 'assistant' | 'system'; + /** + * The content of the message, applicable for `message` items. + * - Message items of role `system` support only `input_text` content + * - Message items of role `user` support `input_text` and `input_audio` + * content + * - Message items of role `assistant` support `text` content. + * + */ + content?: Array<{ + /** + * The content type (`input_text`, `input_audio`, `item_reference`, `text`). + * + */ + type?: 'input_text' | 'input_audio' | 'item_reference' | 'text'; /** - * For an item of type (`message` | `function_call` | `function_call_output`) - * this field allows the client to assign the unique ID of the item. It is - * not required because the server will generate one if not provided. - * - * For an item of type `item_reference`, this field is required and is a - * reference to any item that has previously existed in the conversation. - * - */ - id?: string; - /** - * The type of the item (`message`, `function_call`, `function_call_output`, `item_reference`). - * - */ - type?: 'message' | 'function_call' | 'function_call_output' | 'item_reference'; - /** - * Identifier for the API object being returned - always `realtime.item`. - * - */ - object?: 'realtime.item'; - /** - * The status of the item (`completed`, `incomplete`, `in_progress`). These have no effect - * on the conversation, but are accepted for consistency with the - * `conversation.item.created` event. - * - */ - status?: 'completed' | 'incomplete' | 'in_progress'; - /** - * The role of the message sender (`user`, `assistant`, `system`), only - * applicable for `message` items. - * - */ - role?: 'user' | 'assistant' | 'system'; - /** - * The content of the message, applicable for `message` items. - * - Message items of role `system` support only `input_text` content - * - Message items of role `user` support `input_text` and `input_audio` - * content - * - Message items of role `assistant` support `text` content. - * - */ - content?: Array<{ - /** - * The content type (`input_text`, `input_audio`, `item_reference`, `text`). - * - */ - type?: 'input_text' | 'input_audio' | 'item_reference' | 'text'; - /** - * The text content, used for `input_text` and `text` content types. - * - */ - text?: string; - /** - * ID of a previous conversation item to reference (for `item_reference` - * content types in `response.create` events). These can reference both - * client and server created items. - * - */ - id?: string; - /** - * Base64-encoded audio bytes, used for `input_audio` content type. - * - */ - audio?: string; - /** - * The transcript of the audio, used for `input_audio` content type. - * - */ - transcript?: string; - }>; - /** - * The ID of the function call (for `function_call` and - * `function_call_output` items). If passed on a `function_call_output` - * item, the server will check that a `function_call` item with the same - * ID exists in the conversation history. + * The text content, used for `input_text` and `text` content types. * */ - call_id?: string; + text?: string; /** - * The name of the function being called (for `function_call` items). + * ID of a previous conversation item to reference (for `item_reference` + * content types in `response.create` events). These can reference both + * client and server created items. * */ - name?: string; + id?: string; /** - * The arguments of the function call (for `function_call` items). + * Base64-encoded audio bytes, used for `input_audio` content type. * */ - arguments?: string; + audio?: string; /** - * The output of the function call (for `function_call_output` items). + * The transcript of the audio, used for `input_audio` content type. * */ - output?: string; + transcript?: string; + }>; + /** + * The ID of the function call (for `function_call` and + * `function_call_output` items). If passed on a `function_call_output` + * item, the server will check that a `function_call` item with the same + * ID exists in the conversation history. + * + */ + call_id?: string; + /** + * The name of the function being called (for `function_call` items). + * + */ + name?: string; + /** + * The arguments of the function call (for `function_call` items). + * + */ + arguments?: string; + /** + * The output of the function call (for `function_call_output` items). + * + */ + output?: string; }; /** * The response resource. */ export type RealtimeResponse = { + /** + * The unique ID of the response. + */ + id?: string; + /** + * The object type, must be `realtime.response`. + */ + object?: 'realtime.response'; + /** + * The final status of the response (`completed`, `cancelled`, `failed`, or + * `incomplete`, `in_progress`). + * + */ + status?: 'completed' | 'cancelled' | 'failed' | 'incomplete' | 'in_progress'; + /** + * Additional details about the status. + */ + status_details?: { /** - * The unique ID of the response. - */ - id?: string; - /** - * The object type, must be `realtime.response`. - */ - object?: 'realtime.response'; - /** - * The final status of the response (`completed`, `cancelled`, `failed`, or - * `incomplete`, `in_progress`). - * - */ - status?: 'completed' | 'cancelled' | 'failed' | 'incomplete' | 'in_progress'; - /** - * Additional details about the status. - */ - status_details?: { - /** - * The type of error that caused the response to fail, corresponding - * with the `status` field (`completed`, `cancelled`, `incomplete`, - * `failed`). - * - */ - type?: 'completed' | 'cancelled' | 'incomplete' | 'failed'; - /** - * The reason the Response did not complete. For a `cancelled` Response, - * one of `turn_detected` (the server VAD detected a new start of speech) - * or `client_cancelled` (the client sent a cancel event). For an - * `incomplete` Response, one of `max_output_tokens` or `content_filter` - * (the server-side safety filter activated and cut off the response). - * - */ - reason?: 'turn_detected' | 'client_cancelled' | 'max_output_tokens' | 'content_filter'; - /** - * A description of the error that caused the response to fail, - * populated when the `status` is `failed`. - * - */ - error?: { - /** - * The type of error. - */ - type?: string; - /** - * Error code, if any. - */ - code?: string; - }; - }; - /** - * The list of output items generated by the response. - */ - output?: Array; - metadata?: Metadata; - /** - * Usage statistics for the Response, this will correspond to billing. A - * Realtime API session will maintain a conversation context and append new - * Items to the Conversation, thus output from previous turns (text and - * audio tokens) will become the input for later turns. + * The type of error that caused the response to fail, corresponding + * with the `status` field (`completed`, `cancelled`, `incomplete`, + * `failed`). * */ - usage?: { - /** - * The total number of tokens in the Response including input and output - * text and audio tokens. - * - */ - total_tokens?: number; - /** - * The number of input tokens used in the Response, including text and - * audio tokens. - * - */ - input_tokens?: number; - /** - * The number of output tokens sent in the Response, including text and - * audio tokens. - * - */ - output_tokens?: number; - /** - * Details about the input tokens used in the Response. - */ - input_token_details?: { - /** - * The number of cached tokens used in the Response. - */ - cached_tokens?: number; - /** - * The number of text tokens used in the Response. - */ - text_tokens?: number; - /** - * The number of audio tokens used in the Response. - */ - audio_tokens?: number; - }; - /** - * Details about the output tokens used in the Response. - */ - output_token_details?: { - /** - * The number of text tokens used in the Response. - */ - text_tokens?: number; - /** - * The number of audio tokens used in the Response. - */ - audio_tokens?: number; - }; - }; + type?: 'completed' | 'cancelled' | 'incomplete' | 'failed'; /** - * Which conversation the response is added to, determined by the `conversation` - * field in the `response.create` event. If `auto`, the response will be added to - * the default conversation and the value of `conversation_id` will be an id like - * `conv_1234`. If `none`, the response will not be added to any conversation and - * the value of `conversation_id` will be `null`. If responses are being triggered - * by server VAD, the response will be added to the default conversation, thus - * the `conversation_id` will be an id like `conv_1234`. + * The reason the Response did not complete. For a `cancelled` Response, + * one of `turn_detected` (the server VAD detected a new start of speech) + * or `client_cancelled` (the client sent a cancel event). For an + * `incomplete` Response, one of `max_output_tokens` or `content_filter` + * (the server-side safety filter activated and cut off the response). * */ - conversation_id?: string; + reason?: 'turn_detected' | 'client_cancelled' | 'max_output_tokens' | 'content_filter'; /** - * The voice the model used to respond. - * Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, - * `shimmer`, and `verse`. + * A description of the error that caused the response to fail, + * populated when the `status` is `failed`. * */ - voice?: VoiceIdsShared; + error?: { + /** + * The type of error. + */ + type?: string; + /** + * Error code, if any. + */ + code?: string; + }; + }; + /** + * The list of output items generated by the response. + */ + output?: Array; + metadata?: Metadata; + /** + * Usage statistics for the Response, this will correspond to billing. A + * Realtime API session will maintain a conversation context and append new + * Items to the Conversation, thus output from previous turns (text and + * audio tokens) will become the input for later turns. + * + */ + usage?: { /** - * The set of modalities the model used to respond. If there are multiple modalities, - * the model will pick one, for example if `modalities` is `["text", "audio"]`, the model - * could be responding in either text or audio. + * The total number of tokens in the Response including input and output + * text and audio tokens. * */ - modalities?: Array<'text' | 'audio'>; + total_tokens?: number; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * The number of input tokens used in the Response, including text and + * audio tokens. * */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + input_tokens?: number; /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * The number of output tokens sent in the Response, including text and + * audio tokens. * */ - temperature?: number; + output_tokens?: number; /** - * Maximum number of output tokens for a single assistant response, - * inclusive of tool calls, that was used in this response. - * + * Details about the input tokens used in the Response. */ - max_output_tokens?: number | 'inf'; + input_token_details?: { + /** + * The number of cached tokens used in the Response. + */ + cached_tokens?: number; + /** + * The number of text tokens used in the Response. + */ + text_tokens?: number; + /** + * The number of audio tokens used in the Response. + */ + audio_tokens?: number; + }; + /** + * Details about the output tokens used in the Response. + */ + output_token_details?: { + /** + * The number of text tokens used in the Response. + */ + text_tokens?: number; + /** + * The number of audio tokens used in the Response. + */ + audio_tokens?: number; + }; + }; + /** + * Which conversation the response is added to, determined by the `conversation` + * field in the `response.create` event. If `auto`, the response will be added to + * the default conversation and the value of `conversation_id` will be an id like + * `conv_1234`. If `none`, the response will not be added to any conversation and + * the value of `conversation_id` will be `null`. If responses are being triggered + * by server VAD, the response will be added to the default conversation, thus + * the `conversation_id` will be an id like `conv_1234`. + * + */ + conversation_id?: string; + /** + * The voice the model used to respond. + * Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + * `shimmer`, and `verse`. + * + */ + voice?: VoiceIdsShared; + /** + * The set of modalities the model used to respond. If there are multiple modalities, + * the model will pick one, for example if `modalities` is `["text", "audio"]`, the model + * could be responding in either text or audio. + * + */ + modalities?: Array<'text' | 'audio'>; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * + */ + temperature?: number; + /** + * Maximum number of output tokens for a single assistant response, + * inclusive of tool calls, that was used in this response. + * + */ + max_output_tokens?: number | 'inf'; }; /** * Create a new Realtime response with these parameters */ export type RealtimeResponseCreateParams = { - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. - * + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: Array<'text' | 'audio'>; + /** + * The default system instructions (i.e. system message) prepended to model + * calls. This field allows the client to guide the model on desired + * responses. The model can be instructed on response content and format, + * (e.g. "be extremely succinct", "act friendly", "here are examples of good + * responses") and on audio behavior (e.g. "talk quickly", "inject emotion + * into your voice", "laugh frequently"). The instructions are not guaranteed + * to be followed by the model, but they provide guidance to the model on the + * desired behavior. + * + * Note that the server sets default instructions which will be used if this + * field is not set and are visible in the `session.created` event at the + * start of the session. + * + */ + instructions?: string; + /** + * 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`, and `verse`. + * + */ + voice?: VoiceIdsShared; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ + /** + * The type of the tool, i.e. `function`. */ - modalities?: Array<'text' | 'audio'>; - /** - * The default system instructions (i.e. system message) prepended to model - * calls. This field allows the client to guide the model on desired - * responses. The model can be instructed on response content and format, - * (e.g. "be extremely succinct", "act friendly", "here are examples of good - * responses") and on audio behavior (e.g. "talk quickly", "inject emotion - * into your voice", "laugh frequently"). The instructions are not guaranteed - * to be followed by the model, but they provide guidance to the model on the - * desired behavior. - * - * Note that the server sets default instructions which will be used if this - * field is not set and are visible in the `session.created` event at the - * start of the session. - * - */ - instructions?: string; - /** - * 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`, and `verse`. - * - */ - voice?: VoiceIdsShared; - /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * - */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; - /** - * Tools (functions) available to the model. - */ - tools?: Array<{ - /** - * The type of the tool, i.e. `function`. - */ - type?: 'function'; - /** - * The name of the function. - */ - name?: string; - /** - * The description of the function, including guidance on when and how - * to call it, and guidance about what to tell the user when calling - * (if anything). - * - */ - description?: string; - /** - * Parameters of the function in JSON Schema. - */ - parameters?: { - [key: string]: unknown; - }; - }>; - /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`. - * - */ - tool_choice?: string; - /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - * - */ - temperature?: number; + type?: 'function'; /** - * Maximum number of output tokens for a single assistant response, - * inclusive of tool calls. Provide an integer between 1 and 4096 to - * limit output tokens, or `inf` for the maximum available tokens for a - * given model. Defaults to `inf`. - * + * The name of the function. */ - max_response_output_tokens?: number | 'inf'; + name?: string; /** - * Controls which conversation the response is added to. Currently supports - * `auto` and `none`, with `auto` as the default value. The `auto` value - * means that the contents of the response will be added to the default - * conversation. Set this to `none` to create an out-of-band response which - * will not add items to default conversation. + * The description of the function, including guidance on when and how + * to call it, and guidance about what to tell the user when calling + * (if anything). * */ - conversation?: string | 'auto' | 'none'; - metadata?: Metadata; + description?: string; /** - * Input items to include in the prompt for the model. Using this field - * creates a new context for this Response instead of using the default - * conversation. An empty array `[]` will clear the context for this Response. - * Note that this can include references to items from the default conversation. - * - */ - input?: Array; + * Parameters of the function in JSON Schema. + */ + parameters?: { + [key: string]: unknown; + }; + }>; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`. + * + */ + tool_choice?: string; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * + */ + temperature?: number; + /** + * Maximum number of output tokens for a single assistant response, + * inclusive of tool calls. Provide an integer between 1 and 4096 to + * limit output tokens, or `inf` for the maximum available tokens for a + * given model. Defaults to `inf`. + * + */ + max_response_output_tokens?: number | 'inf'; + /** + * Controls which conversation the response is added to. Currently supports + * `auto` and `none`, with `auto` as the default value. The `auto` value + * means that the contents of the response will be added to the default + * conversation. Set this to `none` to create an out-of-band response which + * will not add items to default conversation. + * + */ + conversation?: string | 'auto' | 'none'; + metadata?: Metadata; + /** + * Input items to include in the prompt for the model. Using this field + * creates a new context for this Response instead of using the default + * conversation. An empty array `[]` will clear the context for this Response. + * Note that this can include references to items from the default conversation. + * + */ + input?: Array; }; /** * A realtime server event. * */ -export type RealtimeServerEvent = ({ - type?: 'RealtimeServerEventConversationCreated'; -} & RealtimeServerEventConversationCreated) | ({ - type?: 'RealtimeServerEventConversationItemCreated'; -} & RealtimeServerEventConversationItemCreated) | ({ - type?: 'RealtimeServerEventConversationItemDeleted'; -} & RealtimeServerEventConversationItemDeleted) | ({ - type?: 'RealtimeServerEventConversationItemInputAudioTranscriptionCompleted'; -} & RealtimeServerEventConversationItemInputAudioTranscriptionCompleted) | ({ - type?: 'RealtimeServerEventConversationItemInputAudioTranscriptionDelta'; -} & RealtimeServerEventConversationItemInputAudioTranscriptionDelta) | ({ - type?: 'RealtimeServerEventConversationItemInputAudioTranscriptionFailed'; -} & RealtimeServerEventConversationItemInputAudioTranscriptionFailed) | ({ - type?: 'RealtimeServerEventConversationItemRetrieved'; -} & RealtimeServerEventConversationItemRetrieved) | ({ - type?: 'RealtimeServerEventConversationItemTruncated'; -} & RealtimeServerEventConversationItemTruncated) | ({ - type?: 'RealtimeServerEventError'; -} & RealtimeServerEventError) | ({ - type?: 'RealtimeServerEventInputAudioBufferCleared'; -} & RealtimeServerEventInputAudioBufferCleared) | ({ - type?: 'RealtimeServerEventInputAudioBufferCommitted'; -} & RealtimeServerEventInputAudioBufferCommitted) | ({ - type?: 'RealtimeServerEventInputAudioBufferSpeechStarted'; -} & RealtimeServerEventInputAudioBufferSpeechStarted) | ({ - type?: 'RealtimeServerEventInputAudioBufferSpeechStopped'; -} & RealtimeServerEventInputAudioBufferSpeechStopped) | ({ - type?: 'RealtimeServerEventRateLimitsUpdated'; -} & RealtimeServerEventRateLimitsUpdated) | ({ - type?: 'RealtimeServerEventResponseAudioDelta'; -} & RealtimeServerEventResponseAudioDelta) | ({ - type?: 'RealtimeServerEventResponseAudioDone'; -} & RealtimeServerEventResponseAudioDone) | ({ - type?: 'RealtimeServerEventResponseAudioTranscriptDelta'; -} & RealtimeServerEventResponseAudioTranscriptDelta) | ({ - type?: 'RealtimeServerEventResponseAudioTranscriptDone'; -} & RealtimeServerEventResponseAudioTranscriptDone) | ({ - type?: 'RealtimeServerEventResponseContentPartAdded'; -} & RealtimeServerEventResponseContentPartAdded) | ({ - type?: 'RealtimeServerEventResponseContentPartDone'; -} & RealtimeServerEventResponseContentPartDone) | ({ - type?: 'RealtimeServerEventResponseCreated'; -} & RealtimeServerEventResponseCreated) | ({ - type?: 'RealtimeServerEventResponseDone'; -} & RealtimeServerEventResponseDone) | ({ - type?: 'RealtimeServerEventResponseFunctionCallArgumentsDelta'; -} & RealtimeServerEventResponseFunctionCallArgumentsDelta) | ({ - type?: 'RealtimeServerEventResponseFunctionCallArgumentsDone'; -} & RealtimeServerEventResponseFunctionCallArgumentsDone) | ({ - type?: 'RealtimeServerEventResponseOutputItemAdded'; -} & RealtimeServerEventResponseOutputItemAdded) | ({ - type?: 'RealtimeServerEventResponseOutputItemDone'; -} & RealtimeServerEventResponseOutputItemDone) | ({ - type?: 'RealtimeServerEventResponseTextDelta'; -} & RealtimeServerEventResponseTextDelta) | ({ - type?: 'RealtimeServerEventResponseTextDone'; -} & RealtimeServerEventResponseTextDone) | ({ - type?: 'RealtimeServerEventSessionCreated'; -} & RealtimeServerEventSessionCreated) | ({ - type?: 'RealtimeServerEventSessionUpdated'; -} & RealtimeServerEventSessionUpdated) | ({ - type?: 'RealtimeServerEventTranscriptionSessionUpdated'; -} & RealtimeServerEventTranscriptionSessionUpdated) | ({ - type?: 'RealtimeServerEventOutputAudioBufferStarted'; -} & RealtimeServerEventOutputAudioBufferStarted) | ({ - type?: 'RealtimeServerEventOutputAudioBufferStopped'; -} & RealtimeServerEventOutputAudioBufferStopped) | ({ - type?: 'RealtimeServerEventOutputAudioBufferCleared'; -} & RealtimeServerEventOutputAudioBufferCleared); +export type RealtimeServerEvent = + | ({ + type?: 'RealtimeServerEventConversationCreated'; + } & RealtimeServerEventConversationCreated) + | ({ + type?: 'RealtimeServerEventConversationItemCreated'; + } & RealtimeServerEventConversationItemCreated) + | ({ + type?: 'RealtimeServerEventConversationItemDeleted'; + } & RealtimeServerEventConversationItemDeleted) + | ({ + type?: 'RealtimeServerEventConversationItemInputAudioTranscriptionCompleted'; + } & RealtimeServerEventConversationItemInputAudioTranscriptionCompleted) + | ({ + type?: 'RealtimeServerEventConversationItemInputAudioTranscriptionDelta'; + } & RealtimeServerEventConversationItemInputAudioTranscriptionDelta) + | ({ + type?: 'RealtimeServerEventConversationItemInputAudioTranscriptionFailed'; + } & RealtimeServerEventConversationItemInputAudioTranscriptionFailed) + | ({ + type?: 'RealtimeServerEventConversationItemRetrieved'; + } & RealtimeServerEventConversationItemRetrieved) + | ({ + type?: 'RealtimeServerEventConversationItemTruncated'; + } & RealtimeServerEventConversationItemTruncated) + | ({ + type?: 'RealtimeServerEventError'; + } & RealtimeServerEventError) + | ({ + type?: 'RealtimeServerEventInputAudioBufferCleared'; + } & RealtimeServerEventInputAudioBufferCleared) + | ({ + type?: 'RealtimeServerEventInputAudioBufferCommitted'; + } & RealtimeServerEventInputAudioBufferCommitted) + | ({ + type?: 'RealtimeServerEventInputAudioBufferSpeechStarted'; + } & RealtimeServerEventInputAudioBufferSpeechStarted) + | ({ + type?: 'RealtimeServerEventInputAudioBufferSpeechStopped'; + } & RealtimeServerEventInputAudioBufferSpeechStopped) + | ({ + type?: 'RealtimeServerEventRateLimitsUpdated'; + } & RealtimeServerEventRateLimitsUpdated) + | ({ + type?: 'RealtimeServerEventResponseAudioDelta'; + } & RealtimeServerEventResponseAudioDelta) + | ({ + type?: 'RealtimeServerEventResponseAudioDone'; + } & RealtimeServerEventResponseAudioDone) + | ({ + type?: 'RealtimeServerEventResponseAudioTranscriptDelta'; + } & RealtimeServerEventResponseAudioTranscriptDelta) + | ({ + type?: 'RealtimeServerEventResponseAudioTranscriptDone'; + } & RealtimeServerEventResponseAudioTranscriptDone) + | ({ + type?: 'RealtimeServerEventResponseContentPartAdded'; + } & RealtimeServerEventResponseContentPartAdded) + | ({ + type?: 'RealtimeServerEventResponseContentPartDone'; + } & RealtimeServerEventResponseContentPartDone) + | ({ + type?: 'RealtimeServerEventResponseCreated'; + } & RealtimeServerEventResponseCreated) + | ({ + type?: 'RealtimeServerEventResponseDone'; + } & RealtimeServerEventResponseDone) + | ({ + type?: 'RealtimeServerEventResponseFunctionCallArgumentsDelta'; + } & RealtimeServerEventResponseFunctionCallArgumentsDelta) + | ({ + type?: 'RealtimeServerEventResponseFunctionCallArgumentsDone'; + } & RealtimeServerEventResponseFunctionCallArgumentsDone) + | ({ + type?: 'RealtimeServerEventResponseOutputItemAdded'; + } & RealtimeServerEventResponseOutputItemAdded) + | ({ + type?: 'RealtimeServerEventResponseOutputItemDone'; + } & RealtimeServerEventResponseOutputItemDone) + | ({ + type?: 'RealtimeServerEventResponseTextDelta'; + } & RealtimeServerEventResponseTextDelta) + | ({ + type?: 'RealtimeServerEventResponseTextDone'; + } & RealtimeServerEventResponseTextDone) + | ({ + type?: 'RealtimeServerEventSessionCreated'; + } & RealtimeServerEventSessionCreated) + | ({ + type?: 'RealtimeServerEventSessionUpdated'; + } & RealtimeServerEventSessionUpdated) + | ({ + type?: 'RealtimeServerEventTranscriptionSessionUpdated'; + } & RealtimeServerEventTranscriptionSessionUpdated) + | ({ + type?: 'RealtimeServerEventOutputAudioBufferStarted'; + } & RealtimeServerEventOutputAudioBufferStarted) + | ({ + type?: 'RealtimeServerEventOutputAudioBufferStopped'; + } & RealtimeServerEventOutputAudioBufferStopped) + | ({ + type?: 'RealtimeServerEventOutputAudioBufferCleared'; + } & RealtimeServerEventOutputAudioBufferCleared); /** * Returned when a conversation is created. Emitted right after session creation. * */ export type RealtimeServerEventConversationCreated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.created`. + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.created`. + */ + type: 'conversation.created'; + /** + * The conversation resource. + */ + conversation: { + /** + * The unique ID of the conversation. */ - type: 'conversation.created'; + id?: string; /** - * The conversation resource. + * The object type, must be `realtime.conversation`. */ - conversation: { - /** - * The unique ID of the conversation. - */ - id?: string; - /** - * The object type, must be `realtime.conversation`. - */ - object?: 'realtime.conversation'; - }; + object?: 'realtime.conversation'; + }; }; /** @@ -10042,22 +10423,22 @@ export type RealtimeServerEventConversationCreated = { * */ export type RealtimeServerEventConversationItemCreated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.item.created`. - */ - type: 'conversation.item.created'; - /** - * The ID of the preceding item in the Conversation context, allows the - * client to understand the order of the conversation. Can be `null` if the - * item has no predecessor. - * - */ - previous_item_id?: string; - item: RealtimeConversationItem; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.item.created`. + */ + type: 'conversation.item.created'; + /** + * The ID of the preceding item in the Conversation context, allows the + * client to understand the order of the conversation. Can be `null` if the + * item has no predecessor. + * + */ + previous_item_id?: string; + item: RealtimeConversationItem; }; /** @@ -10067,18 +10448,18 @@ export type RealtimeServerEventConversationItemCreated = { * */ export type RealtimeServerEventConversationItemDeleted = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.item.deleted`. - */ - type: 'conversation.item.deleted'; - /** - * The ID of the item that was deleted. - */ - item_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.item.deleted`. + */ + type: 'conversation.item.deleted'; + /** + * The ID of the item that was deleted. + */ + item_id: string; }; /** @@ -10095,36 +10476,36 @@ export type RealtimeServerEventConversationItemDeleted = { * */ export type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be - * `conversation.item.input_audio_transcription.completed`. - * - */ - type: 'conversation.item.input_audio_transcription.completed'; - /** - * The ID of the user message item containing the audio. - */ - item_id: string; - /** - * The index of the content part containing the audio. - */ - content_index: number; - /** - * The transcribed text. - */ - transcript: string; - /** - * The log probabilities of the transcription. - */ - logprobs?: Array; - /** - * Usage statistics for the transcription. - */ - usage: TranscriptTextUsageTokens | TranscriptTextUsageDuration; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be + * `conversation.item.input_audio_transcription.completed`. + * + */ + type: 'conversation.item.input_audio_transcription.completed'; + /** + * The ID of the user message item containing the audio. + */ + item_id: string; + /** + * The index of the content part containing the audio. + */ + content_index: number; + /** + * The transcribed text. + */ + transcript: string; + /** + * The log probabilities of the transcription. + */ + logprobs?: Array; + /** + * Usage statistics for the transcription. + */ + usage: TranscriptTextUsageTokens | TranscriptTextUsageDuration; }; /** @@ -10132,30 +10513,30 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted * */ export type RealtimeServerEventConversationItemInputAudioTranscriptionDelta = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.item.input_audio_transcription.delta`. - */ - type: 'conversation.item.input_audio_transcription.delta'; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the content part in the item's content array. - */ - content_index?: number; - /** - * The text delta. - */ - delta?: string; - /** - * The log probabilities of the transcription. - */ - logprobs?: Array; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.item.input_audio_transcription.delta`. + */ + type: 'conversation.item.input_audio_transcription.delta'; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the content part in the item's content array. + */ + content_index?: number; + /** + * The text delta. + */ + delta?: string; + /** + * The log probabilities of the transcription. + */ + logprobs?: Array; }; /** @@ -10165,45 +10546,45 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionDelta = { * */ export type RealtimeServerEventConversationItemInputAudioTranscriptionFailed = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be - * `conversation.item.input_audio_transcription.failed`. - * + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be + * `conversation.item.input_audio_transcription.failed`. + * + */ + type: 'conversation.item.input_audio_transcription.failed'; + /** + * The ID of the user message item. + */ + item_id: string; + /** + * The index of the content part containing the audio. + */ + content_index: number; + /** + * Details of the transcription error. + */ + error: { + /** + * The type of error. + */ + type?: string; + /** + * Error code, if any. */ - type: 'conversation.item.input_audio_transcription.failed'; - /** - * The ID of the user message item. - */ - item_id: string; + code?: string; /** - * The index of the content part containing the audio. + * A human-readable error message. */ - content_index: number; + message?: string; /** - * Details of the transcription error. + * Parameter related to the error, if any. */ - error: { - /** - * The type of error. - */ - type?: string; - /** - * Error code, if any. - */ - code?: string; - /** - * A human-readable error message. - */ - message?: string; - /** - * Parameter related to the error, if any. - */ - param?: string; - }; + param?: string; + }; }; /** @@ -10211,48 +10592,48 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionFailed = { * */ export type RealtimeServerEventConversationItemRetrieved = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.item.retrieved`. - */ - type: 'conversation.item.retrieved'; - item: RealtimeConversationItem; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.item.retrieved`. + */ + type: 'conversation.item.retrieved'; + item: RealtimeConversationItem; }; /** * Returned when an earlier assistant audio message item is truncated by the * client with a `conversation.item.truncate` event. This event is used to - * synchronize the server's understanding of the audio with the client's playback. - * - * This action will truncate the audio and remove the server-side text transcript - * to ensure there is no text in the context that hasn't been heard by the user. - * - */ -export type RealtimeServerEventConversationItemTruncated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.item.truncated`. - */ - type: 'conversation.item.truncated'; - /** - * The ID of the assistant message item that was truncated. - */ - item_id: string; - /** - * The index of the content part that was truncated. - */ - content_index: number; - /** - * The duration up to which the audio was truncated, in milliseconds. - * - */ - audio_end_ms: number; + * synchronize the server's understanding of the audio with the client's playback. + * + * This action will truncate the audio and remove the server-side text transcript + * to ensure there is no text in the context that hasn't been heard by the user. + * + */ +export type RealtimeServerEventConversationItemTruncated = { + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.item.truncated`. + */ + type: 'conversation.item.truncated'; + /** + * The ID of the assistant message item that was truncated. + */ + item_id: string; + /** + * The index of the content part that was truncated. + */ + content_index: number; + /** + * The duration up to which the audio was truncated, in milliseconds. + * + */ + audio_end_ms: number; }; /** @@ -10262,41 +10643,41 @@ export type RealtimeServerEventConversationItemTruncated = { * */ export type RealtimeServerEventError = { + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `error`. + */ + type: 'error'; + /** + * Details of the error. + */ + error: { + /** + * The type of error (e.g., "invalid_request_error", "server_error"). + * + */ + type: string; /** - * The unique ID of the server event. + * Error code, if any. */ - event_id: string; + code?: string; /** - * The event type, must be `error`. + * A human-readable error message. */ - type: 'error'; + message: string; /** - * Details of the error. + * Parameter related to the error, if any. */ - error: { - /** - * The type of error (e.g., "invalid_request_error", "server_error"). - * - */ - type: string; - /** - * Error code, if any. - */ - code?: string; - /** - * A human-readable error message. - */ - message: string; - /** - * Parameter related to the error, if any. - */ - param?: string; - /** - * The event_id of the client event that caused the error, if applicable. - * - */ - event_id?: string; - }; + param?: string; + /** + * The event_id of the client event that caused the error, if applicable. + * + */ + event_id?: string; + }; }; /** @@ -10305,14 +10686,14 @@ export type RealtimeServerEventError = { * */ export type RealtimeServerEventInputAudioBufferCleared = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `input_audio_buffer.cleared`. - */ - type: 'input_audio_buffer.cleared'; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `input_audio_buffer.cleared`. + */ + type: 'input_audio_buffer.cleared'; }; /** @@ -10323,24 +10704,24 @@ export type RealtimeServerEventInputAudioBufferCleared = { * */ export type RealtimeServerEventInputAudioBufferCommitted = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `input_audio_buffer.committed`. - */ - type: 'input_audio_buffer.committed'; - /** - * The ID of the preceding item after which the new item will be inserted. - * Can be `null` if the item has no predecessor. - * - */ - previous_item_id?: string; - /** - * The ID of the user message item that will be created. - */ - item_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `input_audio_buffer.committed`. + */ + type: 'input_audio_buffer.committed'; + /** + * The ID of the preceding item after which the new item will be inserted. + * Can be `null` if the item has no predecessor. + * + */ + previous_item_id?: string; + /** + * The ID of the user message item that will be created. + */ + item_id: string; }; /** @@ -10357,27 +10738,27 @@ export type RealtimeServerEventInputAudioBufferCommitted = { * */ export type RealtimeServerEventInputAudioBufferSpeechStarted = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `input_audio_buffer.speech_started`. - */ - type: 'input_audio_buffer.speech_started'; - /** - * Milliseconds from the start of all audio written to the buffer during the - * session when speech was first detected. This will correspond to the - * beginning of audio sent to the model, and thus includes the - * `prefix_padding_ms` configured in the Session. - * - */ - audio_start_ms: number; - /** - * The ID of the user message item that will be created when speech stops. - * - */ - item_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `input_audio_buffer.speech_started`. + */ + type: 'input_audio_buffer.speech_started'; + /** + * Milliseconds from the start of all audio written to the buffer during the + * session when speech was first detected. This will correspond to the + * beginning of audio sent to the model, and thus includes the + * `prefix_padding_ms` configured in the Session. + * + */ + audio_start_ms: number; + /** + * The ID of the user message item that will be created when speech stops. + * + */ + item_id: string; }; /** @@ -10387,25 +10768,25 @@ export type RealtimeServerEventInputAudioBufferSpeechStarted = { * */ export type RealtimeServerEventInputAudioBufferSpeechStopped = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `input_audio_buffer.speech_stopped`. - */ - type: 'input_audio_buffer.speech_stopped'; - /** - * Milliseconds since the session started when speech stopped. This will - * correspond to the end of audio sent to the model, and thus includes the - * `min_silence_duration_ms` configured in the Session. - * - */ - audio_end_ms: number; - /** - * The ID of the user message item that will be created. - */ - item_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `input_audio_buffer.speech_stopped`. + */ + type: 'input_audio_buffer.speech_stopped'; + /** + * Milliseconds since the session started when speech stopped. This will + * correspond to the end of audio sent to the model, and thus includes the + * `min_silence_duration_ms` configured in the Session. + * + */ + audio_end_ms: number; + /** + * The ID of the user message item that will be created. + */ + item_id: string; }; /** @@ -10417,18 +10798,18 @@ export type RealtimeServerEventInputAudioBufferSpeechStopped = { * */ export type RealtimeServerEventOutputAudioBufferCleared = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `output_audio_buffer.cleared`. - */ - type: 'output_audio_buffer.cleared'; - /** - * The unique ID of the response that produced the audio. - */ - response_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `output_audio_buffer.cleared`. + */ + type: 'output_audio_buffer.cleared'; + /** + * The unique ID of the response that produced the audio. + */ + response_id: string; }; /** @@ -10439,18 +10820,18 @@ export type RealtimeServerEventOutputAudioBufferCleared = { * */ export type RealtimeServerEventOutputAudioBufferStarted = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `output_audio_buffer.started`. - */ - type: 'output_audio_buffer.started'; - /** - * The unique ID of the response that produced the audio. - */ - response_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `output_audio_buffer.started`. + */ + type: 'output_audio_buffer.started'; + /** + * The unique ID of the response that produced the audio. + */ + response_id: string; }; /** @@ -10461,18 +10842,18 @@ export type RealtimeServerEventOutputAudioBufferStarted = { * */ export type RealtimeServerEventOutputAudioBufferStopped = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `output_audio_buffer.stopped`. - */ - type: 'output_audio_buffer.stopped'; - /** - * The unique ID of the response that produced the audio. - */ - response_id: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `output_audio_buffer.stopped`. + */ + type: 'output_audio_buffer.stopped'; + /** + * The unique ID of the response that produced the audio. + */ + response_id: string; }; /** @@ -10483,70 +10864,70 @@ export type RealtimeServerEventOutputAudioBufferStopped = { * */ export type RealtimeServerEventRateLimitsUpdated = { + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `rate_limits.updated`. + */ + type: 'rate_limits.updated'; + /** + * List of rate limit information. + */ + rate_limits: Array<{ /** - * The unique ID of the server event. + * The name of the rate limit (`requests`, `tokens`). + * */ - event_id: string; + name?: 'requests' | 'tokens'; /** - * The event type, must be `rate_limits.updated`. + * The maximum allowed value for the rate limit. */ - type: 'rate_limits.updated'; + limit?: number; /** - * List of rate limit information. + * The remaining value before the limit is reached. */ - rate_limits: Array<{ - /** - * The name of the rate limit (`requests`, `tokens`). - * - */ - name?: 'requests' | 'tokens'; - /** - * The maximum allowed value for the rate limit. - */ - limit?: number; - /** - * The remaining value before the limit is reached. - */ - remaining?: number; - /** - * Seconds until the rate limit resets. - */ - reset_seconds?: number; - }>; + remaining?: number; + /** + * Seconds until the rate limit resets. + */ + reset_seconds?: number; + }>; }; /** * Returned when the model-generated audio is updated. */ export type RealtimeServerEventResponseAudioDelta = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.audio.delta`. - */ - type: 'response.audio.delta'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The index of the content part in the item's content array. - */ - content_index: number; - /** - * Base64-encoded audio data delta. - */ - delta: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.audio.delta`. + */ + type: 'response.audio.delta'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * Base64-encoded audio data delta. + */ + delta: string; }; /** @@ -10555,30 +10936,30 @@ export type RealtimeServerEventResponseAudioDelta = { * */ export type RealtimeServerEventResponseAudioDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.audio.done`. - */ - type: 'response.audio.done'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The index of the content part in the item's content array. - */ - content_index: number; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.audio.done`. + */ + type: 'response.audio.done'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; }; /** @@ -10586,34 +10967,34 @@ export type RealtimeServerEventResponseAudioDone = { * */ export type RealtimeServerEventResponseAudioTranscriptDelta = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.audio_transcript.delta`. - */ - type: 'response.audio_transcript.delta'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The index of the content part in the item's content array. - */ - content_index: number; - /** - * The transcript delta. - */ - delta: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.audio_transcript.delta`. + */ + type: 'response.audio_transcript.delta'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * The transcript delta. + */ + delta: string; }; /** @@ -10623,34 +11004,34 @@ export type RealtimeServerEventResponseAudioTranscriptDelta = { * */ export type RealtimeServerEventResponseAudioTranscriptDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.audio_transcript.done`. - */ - type: 'response.audio_transcript.done'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The index of the content part in the item's content array. - */ - content_index: number; - /** - * The final transcript of the audio. - */ - transcript: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.audio_transcript.done`. + */ + type: 'response.audio_transcript.done'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * The final transcript of the audio. + */ + transcript: string; }; /** @@ -10659,51 +11040,51 @@ export type RealtimeServerEventResponseAudioTranscriptDone = { * */ export type RealtimeServerEventResponseContentPartAdded = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.content_part.added`. - */ - type: 'response.content_part.added'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item to which the content part was added. + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.content_part.added`. + */ + type: 'response.content_part.added'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item to which the content part was added. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * The content part that was added. + */ + part: { + /** + * The content type ("text", "audio"). + */ + type?: 'text' | 'audio'; + /** + * The text content (if type is "text"). */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; + text?: string; /** - * The index of the content part in the item's content array. + * Base64-encoded audio data (if type is "audio"). */ - content_index: number; + audio?: string; /** - * The content part that was added. + * The transcript of the audio (if type is "audio"). */ - part: { - /** - * The content type ("text", "audio"). - */ - type?: 'text' | 'audio'; - /** - * The text content (if type is "text"). - */ - text?: string; - /** - * Base64-encoded audio data (if type is "audio"). - */ - audio?: string; - /** - * The transcript of the audio (if type is "audio"). - */ - transcript?: string; - }; + transcript?: string; + }; }; /** @@ -10712,51 +11093,51 @@ export type RealtimeServerEventResponseContentPartAdded = { * */ export type RealtimeServerEventResponseContentPartDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.content_part.done`. - */ - type: 'response.content_part.done'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.content_part.done`. + */ + type: 'response.content_part.done'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * The content part that is done. + */ + part: { + /** + * The content type ("text", "audio"). + */ + type?: 'text' | 'audio'; + /** + * The text content (if type is "text"). */ - output_index: number; + text?: string; /** - * The index of the content part in the item's content array. + * Base64-encoded audio data (if type is "audio"). */ - content_index: number; + audio?: string; /** - * The content part that is done. + * The transcript of the audio (if type is "audio"). */ - part: { - /** - * The content type ("text", "audio"). - */ - type?: 'text' | 'audio'; - /** - * The text content (if type is "text"). - */ - text?: string; - /** - * Base64-encoded audio data (if type is "audio"). - */ - audio?: string; - /** - * The transcript of the audio (if type is "audio"). - */ - transcript?: string; - }; + transcript?: string; + }; }; /** @@ -10765,15 +11146,15 @@ export type RealtimeServerEventResponseContentPartDone = { * */ export type RealtimeServerEventResponseCreated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.created`. - */ - type: 'response.created'; - response: RealtimeResponse; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.created`. + */ + type: 'response.created'; + response: RealtimeResponse; }; /** @@ -10783,15 +11164,15 @@ export type RealtimeServerEventResponseCreated = { * */ export type RealtimeServerEventResponseDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.done`. - */ - type: 'response.done'; - response: RealtimeResponse; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.done`. + */ + type: 'response.done'; + response: RealtimeResponse; }; /** @@ -10799,35 +11180,35 @@ export type RealtimeServerEventResponseDone = { * */ export type RealtimeServerEventResponseFunctionCallArgumentsDelta = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.function_call_arguments.delta`. - * - */ - type: 'response.function_call_arguments.delta'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the function call item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The ID of the function call. - */ - call_id: string; - /** - * The arguments delta as a JSON string. - */ - delta: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.function_call_arguments.delta`. + * + */ + type: 'response.function_call_arguments.delta'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the function call item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the function call. + */ + call_id: string; + /** + * The arguments delta as a JSON string. + */ + delta: string; }; /** @@ -10836,58 +11217,58 @@ export type RealtimeServerEventResponseFunctionCallArgumentsDelta = { * */ export type RealtimeServerEventResponseFunctionCallArgumentsDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.function_call_arguments.done`. - * - */ - type: 'response.function_call_arguments.done'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the function call item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The ID of the function call. - */ - call_id: string; - /** - * The final arguments as a JSON string. - */ - arguments: string; -}; - -/** - * Returned when a new Item is created during Response generation. - */ -export type RealtimeServerEventResponseOutputItemAdded = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.output_item.added`. - */ - type: 'response.output_item.added'; - /** - * The ID of the Response to which the item belongs. - */ - response_id: string; - /** - * The index of the output item in the Response. - */ - output_index: number; - item: RealtimeConversationItem; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.function_call_arguments.done`. + * + */ + type: 'response.function_call_arguments.done'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the function call item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the function call. + */ + call_id: string; + /** + * The final arguments as a JSON string. + */ + arguments: string; +}; + +/** + * Returned when a new Item is created during Response generation. + */ +export type RealtimeServerEventResponseOutputItemAdded = { + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.output_item.added`. + */ + type: 'response.output_item.added'; + /** + * The ID of the Response to which the item belongs. + */ + response_id: string; + /** + * The index of the output item in the Response. + */ + output_index: number; + item: RealtimeConversationItem; }; /** @@ -10896,57 +11277,57 @@ export type RealtimeServerEventResponseOutputItemAdded = { * */ export type RealtimeServerEventResponseOutputItemDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.output_item.done`. - */ - type: 'response.output_item.done'; - /** - * The ID of the Response to which the item belongs. - */ - response_id: string; - /** - * The index of the output item in the Response. - */ - output_index: number; - item: RealtimeConversationItem; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.output_item.done`. + */ + type: 'response.output_item.done'; + /** + * The ID of the Response to which the item belongs. + */ + response_id: string; + /** + * The index of the output item in the Response. + */ + output_index: number; + item: RealtimeConversationItem; }; /** * Returned when the text value of a "text" content part is updated. */ export type RealtimeServerEventResponseTextDelta = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.text.delta`. - */ - type: 'response.text.delta'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The index of the content part in the item's content array. - */ - content_index: number; - /** - * The text delta. - */ - delta: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.text.delta`. + */ + type: 'response.text.delta'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * The text delta. + */ + delta: string; }; /** @@ -10955,34 +11336,34 @@ export type RealtimeServerEventResponseTextDelta = { * */ export type RealtimeServerEventResponseTextDone = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `response.text.done`. - */ - type: 'response.text.done'; - /** - * The ID of the response. - */ - response_id: string; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item in the response. - */ - output_index: number; - /** - * The index of the content part in the item's content array. - */ - content_index: number; - /** - * The final text content. - */ - text: string; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `response.text.done`. + */ + type: 'response.text.done'; + /** + * The ID of the response. + */ + response_id: string; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The index of the content part in the item's content array. + */ + content_index: number; + /** + * The final text content. + */ + text: string; }; /** @@ -10992,15 +11373,15 @@ export type RealtimeServerEventResponseTextDone = { * */ export type RealtimeServerEventSessionCreated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `session.created`. - */ - type: 'session.created'; - session: RealtimeSession; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `session.created`. + */ + type: 'session.created'; + session: RealtimeSession; }; /** @@ -11009,15 +11390,15 @@ export type RealtimeServerEventSessionCreated = { * */ export type RealtimeServerEventSessionUpdated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `session.updated`. - */ - type: 'session.updated'; - session: RealtimeSession; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `session.updated`. + */ + type: 'session.updated'; + session: RealtimeSession; }; /** @@ -11026,181 +11407,189 @@ export type RealtimeServerEventSessionUpdated = { * */ export type RealtimeServerEventTranscriptionSessionUpdated = { - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `transcription_session.updated`. - */ - type: 'transcription_session.updated'; - session: RealtimeTranscriptionSessionCreateResponse; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `transcription_session.updated`. + */ + type: 'transcription_session.updated'; + session: RealtimeTranscriptionSessionCreateResponse; }; /** * Realtime session object configuration. */ export type RealtimeSession = { - /** - * Unique identifier for the session that looks like `sess_1234567890abcdef`. - * - */ - id?: string; - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. - * - */ - modalities?: unknown; - /** - * The Realtime model used for this session. - * - */ - model?: 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17'; - /** - * The default system instructions (i.e. system message) prepended to model - * calls. This field allows the client to guide the model on desired - * responses. The model can be instructed on response content and format, - * (e.g. "be extremely succinct", "act friendly", "here are examples of good - * responses") and on audio behavior (e.g. "talk quickly", "inject emotion - * into your voice", "laugh frequently"). The instructions are not - * guaranteed to be followed by the model, but they provide guidance to the - * model on the desired behavior. - * - * - * Note that the server sets default instructions which will be used if this - * field is not set and are visible in the `session.created` event at the - * start of the session. + /** + * Unique identifier for the session that looks like `sess_1234567890abcdef`. + * + */ + id?: string; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * The Realtime model used for this session. + * + */ + model?: + | 'gpt-4o-realtime-preview' + | 'gpt-4o-realtime-preview-2024-10-01' + | 'gpt-4o-realtime-preview-2024-12-17' + | 'gpt-4o-realtime-preview-2025-06-03' + | 'gpt-4o-mini-realtime-preview' + | 'gpt-4o-mini-realtime-preview-2024-12-17'; + /** + * The default system instructions (i.e. system message) prepended to model + * calls. This field allows the client to guide the model on desired + * responses. The model can be instructed on response content and format, + * (e.g. "be extremely succinct", "act friendly", "here are examples of good + * responses") and on audio behavior (e.g. "talk quickly", "inject emotion + * into your voice", "laugh frequently"). The instructions are not + * guaranteed to be followed by the model, but they provide guidance to the + * model on the desired behavior. + * + * + * Note that the server sets default instructions which will be used if this + * field is not set and are visible in the `session.created` event at the + * start of the session. + * + */ + instructions?: string; + /** + * 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`, and `verse`. + * + */ + voice?: VoiceIdsShared; + /** + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, + * single channel (mono), and little-endian byte order. + * + */ + input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * For `pcm16`, output audio is sampled at a rate of 24kHz. + * + */ + output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * + */ + input_audio_transcription?: { + /** + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - instructions?: string; + model?: string; /** - * 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`, and `verse`. + * The language of the input audio. Supplying the input language in + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format + * will improve accuracy and latency. * */ - voice?: VoiceIdsShared; + language?: string; /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, - * single channel (mono), and little-endian byte order. + * An optional text to guide the model's style or continue a previous audio + * segment. + * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). + * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology". * */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + prompt?: string; + }; + /** + * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. + * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. + * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + * + */ + turn_detection?: { /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, output audio is sampled at a rate of 24kHz. + * Type of turn detection. * */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + type?: 'server_vad' | 'semantic_vad'; /** - * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`. * */ - input_audio_transcription?: { - /** - * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. - * - */ - model?: string; - /** - * The language of the input audio. Supplying the input language in - * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format - * will improve accuracy and latency. - * - */ - language?: string; - /** - * An optional text to guide the model's style or continue a previous audio - * segment. - * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). - * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology". - * - */ - prompt?: string; - }; + eagerness?: 'low' | 'medium' | 'high' | 'auto'; /** - * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. - * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. - * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A + * higher threshold will require louder audio to activate the model, and + * thus might perform better in noisy environments. * */ - turn_detection?: { - /** - * Type of turn detection. - * - */ - type?: 'server_vad' | 'semantic_vad'; - /** - * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`. - * - */ - eagerness?: 'low' | 'medium' | 'high' | 'auto'; - /** - * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A - * higher threshold will require louder audio to activate the model, and - * thus might perform better in noisy environments. - * - */ - threshold?: number; - /** - * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in - * milliseconds). Defaults to 300ms. - * - */ - prefix_padding_ms?: number; - /** - * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults - * to 500ms. With shorter values the model will respond more quickly, - * but may jump in on short pauses from the user. - * - */ - silence_duration_ms?: number; - /** - * Whether or not to automatically generate a response when a VAD stop event occurs. - * - */ - create_response?: boolean; - /** - * Whether or not to automatically interrupt any ongoing response with output to the default - * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. - * - */ - interrupt_response?: boolean; - }; + threshold?: number; /** - * Configuration for input audio noise reduction. This can be set to `null` to turn off. - * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. - * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - input_audio_noise_reduction?: { - /** - * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. - * - */ - type?: 'near_field' | 'far_field'; - }; + prefix_padding_ms?: number; /** - * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is - * the minimum speed. 1.5 is the maximum speed. This value can only be changed - * in between model turns, not while a response is in progress. + * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults + * to 500ms. With shorter values the model will respond more quickly, + * but may jump in on short pauses from the user. * */ - speed?: number; + silence_duration_ms?: number; /** - * Tracing Configuration - * - * Configuration options for tracing. Set to null to disable tracing. Once - * tracing is enabled for a session, the configuration cannot be modified. - * - * `auto` will create a trace for the session with default values for the - * workflow name, group id, and metadata. - * - */ - tracing?: 'auto' | { + * Whether or not to automatically generate a response when a VAD stop event occurs. + * + */ + create_response?: boolean; + /** + * Whether or not to automatically interrupt any ongoing response with output to the default + * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. + * + */ + interrupt_response?: boolean; + }; + /** + * Configuration for input audio noise reduction. This can be set to `null` to turn off. + * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. + * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + * + */ + input_audio_noise_reduction?: { + /** + * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. + * + */ + type?: 'near_field' | 'far_field'; + }; + /** + * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is + * the minimum speed. 1.5 is the maximum speed. This value can only be changed + * in between model turns, not while a response is in progress. + * + */ + speed?: number; + /** + * Tracing Configuration + * + * Configuration options for tracing. Set to null to disable tracing. Once + * tracing is enabled for a session, the configuration cannot be modified. + * + * `auto` will create a trace for the session with default values for the + * workflow name, group id, and metadata. + * + */ + tracing?: + | 'auto' + | { /** * The name of the workflow to attach to this trace. This is used to * name the trace in the traces dashboard. @@ -11219,205 +11608,213 @@ export type RealtimeSession = { * */ metadata?: { - [key: string]: unknown; + [key: string]: unknown; }; - }; + }; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ /** - * Tools (functions) available to the model. + * The type of the tool, i.e. `function`. */ - tools?: Array<{ - /** - * The type of the tool, i.e. `function`. - */ - type?: 'function'; - /** - * The name of the function. - */ - name?: string; - /** - * The description of the function, including guidance on when and how - * to call it, and guidance about what to tell the user when calling - * (if anything). - * - */ - description?: string; - /** - * Parameters of the function in JSON Schema. - */ - parameters?: { - [key: string]: unknown; - }; - }>; + type?: 'function'; /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. - * + * The name of the function. */ - tool_choice?: string; + name?: string; /** - * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance. + * The description of the function, including guidance on when and how + * to call it, and guidance about what to tell the user when calling + * (if anything). * */ - temperature?: number; + description?: string; /** - * Maximum number of output tokens for a single assistant response, - * inclusive of tool calls. Provide an integer between 1 and 4096 to - * limit output tokens, or `inf` for the maximum available tokens for a - * given model. Defaults to `inf`. - * - */ - max_response_output_tokens?: number | 'inf'; + * Parameters of the function in JSON Schema. + */ + parameters?: { + [key: string]: unknown; + }; + }>; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. + * + */ + tool_choice?: string; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance. + * + */ + temperature?: number; + /** + * Maximum number of output tokens for a single assistant response, + * inclusive of tool calls. Provide an integer between 1 and 4096 to + * limit output tokens, or `inf` for the maximum available tokens for a + * given model. Defaults to `inf`. + * + */ + max_response_output_tokens?: number | 'inf'; }; /** * Realtime session object configuration. */ export type RealtimeSessionCreateRequest = { - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. - * - */ - modalities?: unknown; - /** - * The Realtime model used for this session. + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * The Realtime model used for this session. + * + */ + model?: + | 'gpt-4o-realtime-preview' + | 'gpt-4o-realtime-preview-2024-10-01' + | 'gpt-4o-realtime-preview-2024-12-17' + | 'gpt-4o-realtime-preview-2025-06-03' + | 'gpt-4o-mini-realtime-preview' + | 'gpt-4o-mini-realtime-preview-2024-12-17'; + /** + * The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. + * + * Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session. + * + */ + instructions?: string; + /** + * 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`, and `verse`. + * + */ + voice?: VoiceIdsShared; + /** + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, + * single channel (mono), and little-endian byte order. + * + */ + input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * For `pcm16`, output audio is sampled at a rate of 24kHz. + * + */ + output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * + */ + input_audio_transcription?: { + /** + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - model?: 'gpt-4o-realtime-preview' | 'gpt-4o-realtime-preview-2024-10-01' | 'gpt-4o-realtime-preview-2024-12-17' | 'gpt-4o-realtime-preview-2025-06-03' | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17'; - /** - * The default system instructions (i.e. system message) prepended to model calls. This field allows the client to guide the model on desired responses. The model can be instructed on response content and format, (e.g. "be extremely succinct", "act friendly", "here are examples of good responses") and on audio behavior (e.g. "talk quickly", "inject emotion into your voice", "laugh frequently"). The instructions are not guaranteed to be followed by the model, but they provide guidance to the model on the desired behavior. - * - * Note that the server sets default instructions which will be used if this field is not set and are visible in the `session.created` event at the start of the session. - * - */ - instructions?: string; + model?: string; /** - * 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`, and `verse`. + * The language of the input audio. Supplying the input language in + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format + * will improve accuracy and latency. * */ - voice?: VoiceIdsShared; + language?: string; /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, - * single channel (mono), and little-endian byte order. + * An optional text to guide the model's style or continue a previous audio + * segment. + * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). + * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology". * */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + prompt?: string; + }; + /** + * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. + * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. + * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + * + */ + turn_detection?: { /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, output audio is sampled at a rate of 24kHz. + * Type of turn detection. * */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + type?: 'server_vad' | 'semantic_vad'; /** - * Configuration for input audio transcription, defaults to off and can be set to `null` to turn off once on. Input audio transcription is not native to the model, since the model consumes audio directly. Transcription runs asynchronously through [the /audio/transcriptions endpoint](https://platform.openai.com/docs/api-reference/audio/createTranscription) and should be treated as guidance of input audio content rather than precisely what the model heard. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`. * */ - input_audio_transcription?: { - /** - * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. - * - */ - model?: string; - /** - * The language of the input audio. Supplying the input language in - * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format - * will improve accuracy and latency. - * - */ - language?: string; - /** - * An optional text to guide the model's style or continue a previous audio - * segment. - * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). - * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology". - * - */ - prompt?: string; - }; + eagerness?: 'low' | 'medium' | 'high' | 'auto'; /** - * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. - * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. - * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A + * higher threshold will require louder audio to activate the model, and + * thus might perform better in noisy environments. * */ - turn_detection?: { - /** - * Type of turn detection. - * - */ - type?: 'server_vad' | 'semantic_vad'; - /** - * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`. - * - */ - eagerness?: 'low' | 'medium' | 'high' | 'auto'; - /** - * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A - * higher threshold will require louder audio to activate the model, and - * thus might perform better in noisy environments. - * - */ - threshold?: number; - /** - * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in - * milliseconds). Defaults to 300ms. - * - */ - prefix_padding_ms?: number; - /** - * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults - * to 500ms. With shorter values the model will respond more quickly, - * but may jump in on short pauses from the user. - * - */ - silence_duration_ms?: number; - /** - * Whether or not to automatically generate a response when a VAD stop event occurs. - * - */ - create_response?: boolean; - /** - * Whether or not to automatically interrupt any ongoing response with output to the default - * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. - * - */ - interrupt_response?: boolean; - }; + threshold?: number; /** - * Configuration for input audio noise reduction. This can be set to `null` to turn off. - * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. - * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - input_audio_noise_reduction?: { - /** - * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. - * - */ - type?: 'near_field' | 'far_field'; - }; + prefix_padding_ms?: number; /** - * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is - * the minimum speed. 1.5 is the maximum speed. This value can only be changed - * in between model turns, not while a response is in progress. + * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults + * to 500ms. With shorter values the model will respond more quickly, + * but may jump in on short pauses from the user. * */ - speed?: number; + silence_duration_ms?: number; /** - * Tracing Configuration - * - * Configuration options for tracing. Set to null to disable tracing. Once - * tracing is enabled for a session, the configuration cannot be modified. - * - * `auto` will create a trace for the session with default values for the - * workflow name, group id, and metadata. - * - */ - tracing?: 'auto' | { + * Whether or not to automatically generate a response when a VAD stop event occurs. + * + */ + create_response?: boolean; + /** + * Whether or not to automatically interrupt any ongoing response with output to the default + * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. + * + */ + interrupt_response?: boolean; + }; + /** + * Configuration for input audio noise reduction. This can be set to `null` to turn off. + * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. + * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + * + */ + input_audio_noise_reduction?: { + /** + * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. + * + */ + type?: 'near_field' | 'far_field'; + }; + /** + * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is + * the minimum speed. 1.5 is the maximum speed. This value can only be changed + * in between model turns, not while a response is in progress. + * + */ + speed?: number; + /** + * Tracing Configuration + * + * Configuration options for tracing. Set to null to disable tracing. Once + * tracing is enabled for a session, the configuration cannot be modified. + * + * `auto` will create a trace for the session with default values for the + * workflow name, group id, and metadata. + * + */ + tracing?: + | 'auto' + | { /** * The name of the workflow to attach to this trace. This is used to * name the trace in the traces dashboard. @@ -11426,185 +11823,187 @@ export type RealtimeSessionCreateRequest = { workflow_name?: string; /** * The group id to attach to this trace to enable filtering and - * grouping in the traces dashboard. - * - */ - group_id?: string; - /** - * The arbitrary metadata to attach to this trace to enable - * filtering in the traces dashboard. - * - */ - metadata?: { - [key: string]: unknown; - }; - }; - /** - * Tools (functions) available to the model. - */ - tools?: Array<{ - /** - * The type of the tool, i.e. `function`. - */ - type?: 'function'; - /** - * The name of the function. - */ - name?: string; - /** - * The description of the function, including guidance on when and how - * to call it, and guidance about what to tell the user when calling - * (if anything). - * - */ - description?: string; - /** - * Parameters of the function in JSON Schema. - */ - parameters?: { - [key: string]: unknown; - }; - }>; - /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. - * - */ - tool_choice?: string; - /** - * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance. - * - */ - temperature?: number; - /** - * Maximum number of output tokens for a single assistant response, - * inclusive of tool calls. Provide an integer between 1 and 4096 to - * limit output tokens, or `inf` for the maximum available tokens for a - * given model. Defaults to `inf`. - * - */ - max_response_output_tokens?: number | 'inf'; - /** - * Configuration options for the generated client secret. - * - */ - client_secret?: { - /** - * Configuration for the ephemeral token expiration. - * - */ - expires_after?: { - /** - * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported. - * - */ - anchor: 'created_at'; - /** - * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`. - * - */ - seconds?: number; - }; - }; -}; - -/** - * A new Realtime session configuration, with an ephemeral key. Default TTL - * for keys is one minute. - * - */ -export type RealtimeSessionCreateResponse = { - /** - * Ephemeral key returned by the API. - */ - client_secret: { - /** - * Ephemeral key usable in client environments to authenticate connections - * to the Realtime API. Use this in client-side environments rather than - * a standard API token, which should only be used server-side. + * grouping in the traces dashboard. * */ - value: string; + group_id?: string; /** - * Timestamp for when the token expires. Currently, all tokens expire - * after one minute. + * The arbitrary metadata to attach to this trace to enable + * filtering in the traces dashboard. * */ - expires_at: number; - }; - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. - * - */ - modalities?: unknown; - /** - * The default system instructions (i.e. system message) prepended to model - * calls. This field allows the client to guide the model on desired - * responses. The model can be instructed on response content and format, - * (e.g. "be extremely succinct", "act friendly", "here are examples of good - * responses") and on audio behavior (e.g. "talk quickly", "inject emotion - * into your voice", "laugh frequently"). The instructions are not guaranteed - * to be followed by the model, but they provide guidance to the model on the - * desired behavior. - * - * Note that the server sets default instructions which will be used if this - * field is not set and are visible in the `session.created` event at the - * start of the session. - * - */ - instructions?: string; + metadata?: { + [key: string]: unknown; + }; + }; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ /** - * 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`, and `verse`. - * + * The type of the tool, i.e. `function`. */ - voice?: VoiceIdsShared; + type?: 'function'; /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * + * The name of the function. */ - input_audio_format?: string; + name?: string; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * The description of the function, including guidance on when and how + * to call it, and guidance about what to tell the user when calling + * (if anything). * */ - output_audio_format?: string; + description?: string; /** - * Configuration for input audio transcription, defaults to off and can be - * set to `null` to turn off once on. Input audio transcription is not native - * to the model, since the model consumes audio directly. Transcription runs - * asynchronously and should be treated as rough guidance - * rather than the representation understood by the model. + * Parameters of the function in JSON Schema. + */ + parameters?: { + [key: string]: unknown; + }; + }>; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. + * + */ + tool_choice?: string; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. For audio models a temperature of 0.8 is highly recommended for best performance. + * + */ + temperature?: number; + /** + * Maximum number of output tokens for a single assistant response, + * inclusive of tool calls. Provide an integer between 1 and 4096 to + * limit output tokens, or `inf` for the maximum available tokens for a + * given model. Defaults to `inf`. + * + */ + max_response_output_tokens?: number | 'inf'; + /** + * Configuration options for the generated client secret. + * + */ + client_secret?: { + /** + * Configuration for the ephemeral token expiration. * */ - input_audio_transcription?: { - /** - * The model to use for transcription. - * - */ - model?: string; + expires_after?: { + /** + * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported. + * + */ + anchor: 'created_at'; + /** + * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`. + * + */ + seconds?: number; }; + }; +}; + +/** + * A new Realtime session configuration, with an ephemeral key. Default TTL + * for keys is one minute. + * + */ +export type RealtimeSessionCreateResponse = { + /** + * Ephemeral key returned by the API. + */ + client_secret: { /** - * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is - * the minimum speed. 1.5 is the maximum speed. This value can only be changed - * in between model turns, not while a response is in progress. + * Ephemeral key usable in client environments to authenticate connections + * to the Realtime API. Use this in client-side environments rather than + * a standard API token, which should only be used server-side. * */ - speed?: number; + value: string; /** - * Tracing Configuration - * - * Configuration options for tracing. Set to null to disable tracing. Once - * tracing is enabled for a session, the configuration cannot be modified. + * Timestamp for when the token expires. Currently, all tokens expire + * after one minute. * - * `auto` will create a trace for the session with default values for the - * workflow name, group id, and metadata. + */ + expires_at: number; + }; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * The default system instructions (i.e. system message) prepended to model + * calls. This field allows the client to guide the model on desired + * responses. The model can be instructed on response content and format, + * (e.g. "be extremely succinct", "act friendly", "here are examples of good + * responses") and on audio behavior (e.g. "talk quickly", "inject emotion + * into your voice", "laugh frequently"). The instructions are not guaranteed + * to be followed by the model, but they provide guidance to the model on the + * desired behavior. + * + * Note that the server sets default instructions which will be used if this + * field is not set and are visible in the `session.created` event at the + * start of the session. + * + */ + instructions?: string; + /** + * 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`, and `verse`. + * + */ + voice?: VoiceIdsShared; + /** + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + input_audio_format?: string; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + output_audio_format?: string; + /** + * Configuration for input audio transcription, defaults to off and can be + * set to `null` to turn off once on. Input audio transcription is not native + * to the model, since the model consumes audio directly. Transcription runs + * asynchronously and should be treated as rough guidance + * rather than the representation understood by the model. + * + */ + input_audio_transcription?: { + /** + * The model to use for transcription. * */ - tracing?: 'auto' | { + model?: string; + }; + /** + * The speed of the model's spoken response. 1.0 is the default speed. 0.25 is + * the minimum speed. 1.5 is the maximum speed. This value can only be changed + * in between model turns, not while a response is in progress. + * + */ + speed?: number; + /** + * Tracing Configuration + * + * Configuration options for tracing. Set to null to disable tracing. Once + * tracing is enabled for a session, the configuration cannot be modified. + * + * `auto` will create a trace for the session with default values for the + * workflow name, group id, and metadata. + * + */ + tracing?: + | 'auto' + | { /** * The name of the workflow to attach to this trace. This is used to * name the trace in the traces dashboard. @@ -11623,222 +12022,222 @@ export type RealtimeSessionCreateResponse = { * */ metadata?: { - [key: string]: unknown; + [key: string]: unknown; }; - }; + }; + /** + * Configuration for turn detection. Can be set to `null` to turn off. Server + * VAD means that the model will detect the start and end of speech based on + * audio volume and respond at the end of user speech. + * + */ + turn_detection?: { /** - * Configuration for turn detection. Can be set to `null` to turn off. Server - * VAD means that the model will detect the start and end of speech based on - * audio volume and respond at the end of user speech. + * Type of turn detection, only `server_vad` is currently supported. * */ - turn_detection?: { - /** - * Type of turn detection, only `server_vad` is currently supported. - * - */ - type?: string; - /** - * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A - * higher threshold will require louder audio to activate the model, and - * thus might perform better in noisy environments. - * - */ - threshold?: number; - /** - * Amount of audio to include before the VAD detected speech (in - * milliseconds). Defaults to 300ms. - * - */ - prefix_padding_ms?: number; - /** - * Duration of silence to detect speech stop (in milliseconds). Defaults - * to 500ms. With shorter values the model will respond more quickly, - * but may jump in on short pauses from the user. - * - */ - silence_duration_ms?: number; - }; + type?: string; /** - * Tools (functions) available to the model. + * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A + * higher threshold will require louder audio to activate the model, and + * thus might perform better in noisy environments. + * */ - tools?: Array<{ - /** - * The type of the tool, i.e. `function`. - */ - type?: 'function'; - /** - * The name of the function. - */ - name?: string; - /** - * The description of the function, including guidance on when and how - * to call it, and guidance about what to tell the user when calling - * (if anything). - * - */ - description?: string; - /** - * Parameters of the function in JSON Schema. - */ - parameters?: { - [key: string]: unknown; - }; - }>; + threshold?: number; /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. + * Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - tool_choice?: string; + prefix_padding_ms?: number; /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * Duration of silence to detect speech stop (in milliseconds). Defaults + * to 500ms. With shorter values the model will respond more quickly, + * but may jump in on short pauses from the user. * */ - temperature?: number; + silence_duration_ms?: number; + }; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ + /** + * The type of the tool, i.e. `function`. + */ + type?: 'function'; + /** + * The name of the function. + */ + name?: string; /** - * Maximum number of output tokens for a single assistant response, - * inclusive of tool calls. Provide an integer between 1 and 4096 to - * limit output tokens, or `inf` for the maximum available tokens for a - * given model. Defaults to `inf`. + * The description of the function, including guidance on when and how + * to call it, and guidance about what to tell the user when calling + * (if anything). * */ - max_response_output_tokens?: number | 'inf'; + description?: string; + /** + * Parameters of the function in JSON Schema. + */ + parameters?: { + [key: string]: unknown; + }; + }>; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. + * + */ + tool_choice?: string; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * + */ + temperature?: number; + /** + * Maximum number of output tokens for a single assistant response, + * inclusive of tool calls. Provide an integer between 1 and 4096 to + * limit output tokens, or `inf` for the maximum available tokens for a + * given model. Defaults to `inf`. + * + */ + max_response_output_tokens?: number | 'inf'; }; /** * Realtime transcription session object configuration. */ export type RealtimeTranscriptionSessionCreateRequest = { + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, + * single channel (mono), and little-endian byte order. + * + */ + input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * + */ + input_audio_transcription?: { + /** + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. + * + */ + model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1'; + /** + * The language of the input audio. Supplying the input language in + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format + * will improve accuracy and latency. + * + */ + language?: string; /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. + * An optional text to guide the model's style or continue a previous audio + * segment. + * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). + * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology". * */ - modalities?: unknown; + prompt?: string; + }; + /** + * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. + * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. + * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + * + */ + turn_detection?: { /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, input audio must be 16-bit PCM at a 24kHz sample rate, - * single channel (mono), and little-endian byte order. + * Type of turn detection. * */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + type?: 'server_vad' | 'semantic_vad'; /** - * Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`. * */ - input_audio_transcription?: { - /** - * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. - * - */ - model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1'; - /** - * The language of the input audio. Supplying the input language in - * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format - * will improve accuracy and latency. - * - */ - language?: string; - /** - * An optional text to guide the model's style or continue a previous audio - * segment. - * For `whisper-1`, the [prompt is a list of keywords](https://platform.openai.com/docs/guides/speech-to-text#prompting). - * For `gpt-4o-transcribe` models, the prompt is a free text string, for example "expect words related to technology". - * - */ - prompt?: string; - }; + eagerness?: 'low' | 'medium' | 'high' | 'auto'; /** - * Configuration for turn detection, ether Server VAD or Semantic VAD. This can be set to `null` to turn off, in which case the client must manually trigger model response. - * Server VAD means that the model will detect the start and end of speech based on audio volume and respond at the end of user speech. - * Semantic VAD is more advanced and uses a turn detection model (in conjunction with VAD) to semantically estimate whether the user has finished speaking, then dynamically sets a timeout based on this probability. For example, if user audio trails off with "uhhm", the model will score a low probability of turn end and wait longer for the user to continue speaking. This can be useful for more natural conversations, but may have a higher latency. + * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A + * higher threshold will require louder audio to activate the model, and + * thus might perform better in noisy environments. * */ - turn_detection?: { - /** - * Type of turn detection. - * - */ - type?: 'server_vad' | 'semantic_vad'; - /** - * Used only for `semantic_vad` mode. The eagerness of the model to respond. `low` will wait longer for the user to continue speaking, `high` will respond more quickly. `auto` is the default and is equivalent to `medium`. - * - */ - eagerness?: 'low' | 'medium' | 'high' | 'auto'; - /** - * Used only for `server_vad` mode. Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A - * higher threshold will require louder audio to activate the model, and - * thus might perform better in noisy environments. - * - */ - threshold?: number; - /** - * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in - * milliseconds). Defaults to 300ms. - * - */ - prefix_padding_ms?: number; - /** - * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults - * to 500ms. With shorter values the model will respond more quickly, - * but may jump in on short pauses from the user. - * - */ - silence_duration_ms?: number; - /** - * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions. - * - */ - create_response?: boolean; - /** - * Whether or not to automatically interrupt any ongoing response with output to the default - * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. Not available for transcription sessions. - * - */ - interrupt_response?: boolean; - }; + threshold?: number; /** - * Configuration for input audio noise reduction. This can be set to `null` to turn off. - * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. - * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - input_audio_noise_reduction?: { - /** - * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. - * - */ - type?: 'near_field' | 'far_field'; - }; + prefix_padding_ms?: number; /** - * The set of items to include in the transcription. Current available items are: - * - `item.input_audio_transcription.logprobs` + * Used only for `server_vad` mode. Duration of silence to detect speech stop (in milliseconds). Defaults + * to 500ms. With shorter values the model will respond more quickly, + * but may jump in on short pauses from the user. * */ - include?: Array; + silence_duration_ms?: number; /** - * Configuration options for the generated client secret. + * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions. * */ - client_secret?: { - /** - * Configuration for the ephemeral token expiration. - * - */ - expires_at?: { - /** - * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported. - * - */ - anchor?: 'created_at'; - /** - * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`. - * - */ - seconds?: number; - }; + create_response?: boolean; + /** + * Whether or not to automatically interrupt any ongoing response with output to the default + * conversation (i.e. `conversation` of `auto`) when a VAD start event occurs. Not available for transcription sessions. + * + */ + interrupt_response?: boolean; + }; + /** + * Configuration for input audio noise reduction. This can be set to `null` to turn off. + * Noise reduction filters audio added to the input audio buffer before it is sent to VAD and the model. + * Filtering the audio can improve VAD and turn detection accuracy (reducing false positives) and model performance by improving perception of the input audio. + * + */ + input_audio_noise_reduction?: { + /** + * Type of noise reduction. `near_field` is for close-talking microphones such as headphones, `far_field` is for far-field microphones such as laptop or conference room microphones. + * + */ + type?: 'near_field' | 'far_field'; + }; + /** + * The set of items to include in the transcription. Current available items are: + * - `item.input_audio_transcription.logprobs` + * + */ + include?: Array; + /** + * Configuration options for the generated client secret. + * + */ + client_secret?: { + /** + * Configuration for the ephemeral token expiration. + * + */ + expires_at?: { + /** + * The anchor point for the ephemeral token expiration. Only `created_at` is currently supported. + * + */ + anchor?: 'created_at'; + /** + * The number of seconds from the anchor point to the expiration. Select a value between `10` and `7200`. + * + */ + seconds?: number; }; + }; }; /** @@ -11850,95 +12249,95 @@ export type RealtimeTranscriptionSessionCreateRequest = { * */ export type RealtimeTranscriptionSessionCreateResponse = { + /** + * Ephemeral key returned by the API. Only present when the session is + * created on the server via REST API. + * + */ + client_secret: { /** - * Ephemeral key returned by the API. Only present when the session is - * created on the server via REST API. + * Ephemeral key usable in client environments to authenticate connections + * to the Realtime API. Use this in client-side environments rather than + * a standard API token, which should only be used server-side. * */ - client_secret: { - /** - * Ephemeral key usable in client environments to authenticate connections - * to the Realtime API. Use this in client-side environments rather than - * a standard API token, which should only be used server-side. - * - */ - value: string; - /** - * Timestamp for when the token expires. Currently, all tokens expire - * after one minute. - * - */ - expires_at: number; - }; + value: string; /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. + * Timestamp for when the token expires. Currently, all tokens expire + * after one minute. + * + */ + expires_at: number; + }; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + input_audio_format?: string; + /** + * Configuration of the transcription model. + * + */ + input_audio_transcription?: { + /** + * The model to use for transcription. Can be `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, or `whisper-1`. + * + */ + model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1'; + /** + * The language of the input audio. Supplying the input language in + * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format + * will improve accuracy and latency. * */ - modalities?: unknown; + language?: string; /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * An optional text to guide the model's style or continue a previous audio + * segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match + * the audio language. * */ - input_audio_format?: string; + prompt?: string; + }; + /** + * Configuration for turn detection. Can be set to `null` to turn off. Server + * VAD means that the model will detect the start and end of speech based on + * audio volume and respond at the end of user speech. + * + */ + turn_detection?: { /** - * Configuration of the transcription model. + * Type of turn detection, only `server_vad` is currently supported. * */ - input_audio_transcription?: { - /** - * The model to use for transcription. Can be `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, or `whisper-1`. - * - */ - model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1'; - /** - * The language of the input audio. Supplying the input language in - * [ISO-639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g. `en`) format - * will improve accuracy and latency. - * - */ - language?: string; - /** - * An optional text to guide the model's style or continue a previous audio - * segment. The [prompt](https://platform.openai.com/docs/guides/speech-to-text#prompting) should match - * the audio language. - * - */ - prompt?: string; - }; + type?: string; /** - * Configuration for turn detection. Can be set to `null` to turn off. Server - * VAD means that the model will detect the start and end of speech based on - * audio volume and respond at the end of user speech. + * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A + * higher threshold will require louder audio to activate the model, and + * thus might perform better in noisy environments. * */ - turn_detection?: { - /** - * Type of turn detection, only `server_vad` is currently supported. - * - */ - type?: string; - /** - * Activation threshold for VAD (0.0 to 1.0), this defaults to 0.5. A - * higher threshold will require louder audio to activate the model, and - * thus might perform better in noisy environments. - * - */ - threshold?: number; - /** - * Amount of audio to include before the VAD detected speech (in - * milliseconds). Defaults to 300ms. - * - */ - prefix_padding_ms?: number; - /** - * Duration of silence to detect speech stop (in milliseconds). Defaults - * to 500ms. With shorter values the model will respond more quickly, - * but may jump in on short pauses from the user. - * - */ - silence_duration_ms?: number; - }; + threshold?: number; + /** + * Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. + * + */ + prefix_padding_ms?: number; + /** + * Duration of silence to detect speech stop (in milliseconds). Defaults + * to 500ms. With shorter values the model will respond more quickly, + * but may jump in on short pauses from the user. + * + */ + silence_duration_ms?: number; + }; }; /** @@ -11951,25 +12350,25 @@ export type RealtimeTranscriptionSessionCreateResponse = { * */ export type Reasoning = { - effort?: ReasoningEffort; - /** - * A summary of the reasoning performed by the model. This can be - * useful for debugging and understanding the model's reasoning process. - * One of `auto`, `concise`, or `detailed`. - * - */ - summary?: 'auto' | 'concise' | 'detailed'; - /** - * **Deprecated:** use `summary` instead. - * - * A summary of the reasoning performed by the model. This can be - * useful for debugging and understanding the model's reasoning process. - * One of `auto`, `concise`, or `detailed`. - * - * - * @deprecated - */ - generate_summary?: 'auto' | 'concise' | 'detailed'; + effort?: ReasoningEffort; + /** + * A summary of the reasoning performed by the model. This can be + * useful for debugging and understanding the model's reasoning process. + * One of `auto`, `concise`, or `detailed`. + * + */ + summary?: 'auto' | 'concise' | 'detailed'; + /** + * **Deprecated:** use `summary` instead. + * + * A summary of the reasoning performed by the model. This can be + * useful for debugging and understanding the model's reasoning process. + * One of `auto`, `concise`, or `detailed`. + * + * + * @deprecated + */ + generate_summary?: 'auto' | 'concise' | 'detailed'; }; /** @@ -11981,10 +12380,10 @@ export type Reasoning = { * */ export const ReasoningEffort = { - MINIMAL: 'minimal', - LOW: 'low', - MEDIUM: 'medium', - HIGH: 'high' + MINIMAL: 'minimal', + LOW: 'low', + MEDIUM: 'medium', + HIGH: 'high', } as const; /** @@ -11995,7 +12394,7 @@ export const ReasoningEffort = { * on reasoning in a response. * */ -export type ReasoningEffort = typeof ReasoningEffort[keyof typeof ReasoningEffort]; +export type ReasoningEffort = (typeof ReasoningEffort)[keyof typeof ReasoningEffort]; /** * Reasoning @@ -12007,66 +12406,67 @@ export type ReasoningEffort = typeof ReasoningEffort[keyof typeof ReasoningEffor * */ export type ReasoningItem = { - /** - * The type of the object. Always `reasoning`. - * - */ - type: 'reasoning'; - /** - * The unique identifier of the reasoning content. - * - */ - id: string; - /** - * The encrypted content of the reasoning item - populated when a response is - * generated with `reasoning.encrypted_content` in the `include` parameter. - * - */ - encrypted_content?: string; - /** - * Reasoning summary content. + /** + * The type of the object. Always `reasoning`. + * + */ + type: 'reasoning'; + /** + * The unique identifier of the reasoning content. + * + */ + id: string; + /** + * The encrypted content of the reasoning item - populated when a response is + * generated with `reasoning.encrypted_content` in the `include` parameter. + * + */ + encrypted_content?: string; + /** + * Reasoning summary content. + * + */ + summary: Array<{ + /** + * The type of the object. Always `summary_text`. + * + */ + type: 'summary_text'; + /** + * A summary of the reasoning output from the model so far. * */ - summary: Array<{ - /** - * The type of the object. Always `summary_text`. - * - */ - type: 'summary_text'; - /** - * A summary of the reasoning output from the model so far. - * - */ - text: string; - }>; + text: string; + }>; + /** + * Reasoning text content. + * + */ + content?: Array<{ /** - * Reasoning text content. + * The type of the object. Always `reasoning_text`. * */ - content?: Array<{ - /** - * The type of the object. Always `reasoning_text`. - * - */ - type: 'reasoning_text'; - /** - * Reasoning text output from the model. - * - */ - text: string; - }>; + type: 'reasoning_text'; /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. + * Reasoning text output from the model. * */ - status?: 'in_progress' | 'completed' | 'incomplete'; + text: string; + }>; + /** + * The status of the item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. + * + */ + status?: 'in_progress' | 'completed' | 'incomplete'; }; /** * The response object */ -export type Response = ModelResponseProperties & ResponseProperties & { +export type Response = ModelResponseProperties & + ResponseProperties & { /** * Unique identifier for this Response. * @@ -12094,10 +12494,10 @@ export type Response = ModelResponseProperties & ResponseProperties & { * */ incomplete_details: { - /** - * The reason why the response is incomplete. - */ - reason?: 'max_output_tokens' | 'content_filter'; + /** + * The reason why the response is incomplete. + */ + reason?: 'max_output_tokens' | 'content_filter'; }; /** * An array of content items generated by the model. @@ -12133,286 +12533,286 @@ export type Response = ModelResponseProperties & ResponseProperties & { * */ parallel_tool_calls: boolean; -}; + }; /** * Emitted when there is a partial audio response. */ export type ResponseAudioDeltaEvent = { - /** - * The type of the event. Always `response.audio.delta`. - * - */ - type: 'response.audio.delta'; - /** - * A sequence number for this chunk of the stream response. - * - */ - sequence_number: number; - /** - * A chunk of Base64 encoded response audio bytes. - * - */ - delta: string; + /** + * The type of the event. Always `response.audio.delta`. + * + */ + type: 'response.audio.delta'; + /** + * A sequence number for this chunk of the stream response. + * + */ + sequence_number: number; + /** + * A chunk of Base64 encoded response audio bytes. + * + */ + delta: string; }; /** * Emitted when the audio response is complete. */ export type ResponseAudioDoneEvent = { - /** - * The type of the event. Always `response.audio.done`. - * - */ - type: 'response.audio.done'; - /** - * The sequence number of the delta. - * - */ - sequence_number: number; + /** + * The type of the event. Always `response.audio.done`. + * + */ + type: 'response.audio.done'; + /** + * The sequence number of the delta. + * + */ + sequence_number: number; }; /** * Emitted when there is a partial transcript of audio. - */ -export type ResponseAudioTranscriptDeltaEvent = { - /** - * The type of the event. Always `response.audio.transcript.delta`. - * - */ - type: 'response.audio.transcript.delta'; - /** - * The partial transcript of the audio response. - * - */ - delta: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + */ +export type ResponseAudioTranscriptDeltaEvent = { + /** + * The type of the event. Always `response.audio.transcript.delta`. + * + */ + type: 'response.audio.transcript.delta'; + /** + * The partial transcript of the audio response. + * + */ + delta: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** * Emitted when the full audio transcript is completed. */ export type ResponseAudioTranscriptDoneEvent = { - /** - * The type of the event. Always `response.audio.transcript.done`. - * - */ - type: 'response.audio.transcript.done'; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.audio.transcript.done`. + * + */ + type: 'response.audio.transcript.done'; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** * Emitted when a partial code snippet is streamed by the code interpreter. */ export type ResponseCodeInterpreterCallCodeDeltaEvent = { - /** - * The type of the event. Always `response.code_interpreter_call_code.delta`. - */ - type: 'response.code_interpreter_call_code.delta'; - /** - * The index of the output item in the response for which the code is being streamed. - */ - output_index: number; - /** - * The unique identifier of the code interpreter tool call item. - */ - item_id: string; - /** - * The partial code snippet being streamed by the code interpreter. - */ - delta: string; - /** - * The sequence number of this event, used to order streaming events. - */ - sequence_number: number; + /** + * The type of the event. Always `response.code_interpreter_call_code.delta`. + */ + type: 'response.code_interpreter_call_code.delta'; + /** + * The index of the output item in the response for which the code is being streamed. + */ + output_index: number; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The partial code snippet being streamed by the code interpreter. + */ + delta: string; + /** + * The sequence number of this event, used to order streaming events. + */ + sequence_number: number; }; /** * Emitted when the code snippet is finalized by the code interpreter. */ export type ResponseCodeInterpreterCallCodeDoneEvent = { - /** - * The type of the event. Always `response.code_interpreter_call_code.done`. - */ - type: 'response.code_interpreter_call_code.done'; - /** - * The index of the output item in the response for which the code is finalized. - */ - output_index: number; - /** - * The unique identifier of the code interpreter tool call item. - */ - item_id: string; - /** - * The final code snippet output by the code interpreter. - */ - code: string; - /** - * The sequence number of this event, used to order streaming events. - */ - sequence_number: number; + /** + * The type of the event. Always `response.code_interpreter_call_code.done`. + */ + type: 'response.code_interpreter_call_code.done'; + /** + * The index of the output item in the response for which the code is finalized. + */ + output_index: number; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The final code snippet output by the code interpreter. + */ + code: string; + /** + * The sequence number of this event, used to order streaming events. + */ + sequence_number: number; }; /** * Emitted when the code interpreter call is completed. */ export type ResponseCodeInterpreterCallCompletedEvent = { - /** - * The type of the event. Always `response.code_interpreter_call.completed`. - */ - type: 'response.code_interpreter_call.completed'; - /** - * The index of the output item in the response for which the code interpreter call is completed. - */ - output_index: number; - /** - * The unique identifier of the code interpreter tool call item. - */ - item_id: string; - /** - * The sequence number of this event, used to order streaming events. - */ - sequence_number: number; + /** + * The type of the event. Always `response.code_interpreter_call.completed`. + */ + type: 'response.code_interpreter_call.completed'; + /** + * The index of the output item in the response for which the code interpreter call is completed. + */ + output_index: number; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The sequence number of this event, used to order streaming events. + */ + sequence_number: number; }; /** * Emitted when a code interpreter call is in progress. */ export type ResponseCodeInterpreterCallInProgressEvent = { - /** - * The type of the event. Always `response.code_interpreter_call.in_progress`. - */ - type: 'response.code_interpreter_call.in_progress'; - /** - * The index of the output item in the response for which the code interpreter call is in progress. - */ - output_index: number; - /** - * The unique identifier of the code interpreter tool call item. - */ - item_id: string; - /** - * The sequence number of this event, used to order streaming events. - */ - sequence_number: number; + /** + * The type of the event. Always `response.code_interpreter_call.in_progress`. + */ + type: 'response.code_interpreter_call.in_progress'; + /** + * The index of the output item in the response for which the code interpreter call is in progress. + */ + output_index: number; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The sequence number of this event, used to order streaming events. + */ + sequence_number: number; }; /** * Emitted when the code interpreter is actively interpreting the code snippet. */ export type ResponseCodeInterpreterCallInterpretingEvent = { - /** - * The type of the event. Always `response.code_interpreter_call.interpreting`. - */ - type: 'response.code_interpreter_call.interpreting'; - /** - * The index of the output item in the response for which the code interpreter is interpreting code. - */ - output_index: number; - /** - * The unique identifier of the code interpreter tool call item. - */ - item_id: string; - /** - * The sequence number of this event, used to order streaming events. - */ - sequence_number: number; + /** + * The type of the event. Always `response.code_interpreter_call.interpreting`. + */ + type: 'response.code_interpreter_call.interpreting'; + /** + * The index of the output item in the response for which the code interpreter is interpreting code. + */ + output_index: number; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The sequence number of this event, used to order streaming events. + */ + sequence_number: number; }; /** * Emitted when the model response is complete. */ export type ResponseCompletedEvent = { - /** - * The type of the event. Always `response.completed`. - * - */ - type: 'response.completed'; - /** - * Properties of the completed response. - * - */ - response: Response; - /** - * The sequence number for this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.completed`. + * + */ + type: 'response.completed'; + /** + * Properties of the completed response. + * + */ + response: Response; + /** + * The sequence number for this event. + */ + sequence_number: number; }; /** * Emitted when a new content part is added. */ export type ResponseContentPartAddedEvent = { - /** - * The type of the event. Always `response.content_part.added`. - * - */ - type: 'response.content_part.added'; - /** - * The ID of the output item that the content part was added to. - * - */ - item_id: string; - /** - * The index of the output item that the content part was added to. - * - */ - output_index: number; - /** - * The index of the content part that was added. - * - */ - content_index: number; - /** - * The content part that was added. - * - */ - part: OutputContent; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.content_part.added`. + * + */ + type: 'response.content_part.added'; + /** + * The ID of the output item that the content part was added to. + * + */ + item_id: string; + /** + * The index of the output item that the content part was added to. + * + */ + output_index: number; + /** + * The index of the content part that was added. + * + */ + content_index: number; + /** + * The content part that was added. + * + */ + part: OutputContent; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** * Emitted when a content part is done. */ export type ResponseContentPartDoneEvent = { - /** - * The type of the event. Always `response.content_part.done`. - * - */ - type: 'response.content_part.done'; - /** - * The ID of the output item that the content part was added to. - * - */ - item_id: string; - /** - * The index of the output item that the content part was added to. - * - */ - output_index: number; - /** - * The index of the content part that is done. - * - */ - content_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The content part that is done. - * - */ - part: OutputContent; + /** + * The type of the event. Always `response.content_part.done`. + * + */ + type: 'response.content_part.done'; + /** + * The ID of the output item that the content part was added to. + * + */ + item_id: string; + /** + * The index of the output item that the content part was added to. + * + */ + output_index: number; + /** + * The index of the content part that is done. + * + */ + content_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The content part that is done. + * + */ + part: OutputContent; }; /** @@ -12420,20 +12820,20 @@ export type ResponseContentPartDoneEvent = { * */ export type ResponseCreatedEvent = { - /** - * The type of the event. Always `response.created`. - * - */ - type: 'response.created'; - /** - * The response that was created. - * - */ - response: Response; - /** - * The sequence number for this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.created`. + * + */ + type: 'response.created'; + /** + * The response that was created. + * + */ + response: Response; + /** + * The sequence number for this event. + */ + sequence_number: number; }; /** @@ -12443,26 +12843,26 @@ export type ResponseCreatedEvent = { * */ export type ResponseCustomToolCallInputDeltaEvent = { - /** - * The event type identifier. - */ - type: 'response.custom_tool_call_input.delta'; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The index of the output this delta applies to. - */ - output_index: number; - /** - * Unique identifier for the API item associated with this event. - */ - item_id: string; - /** - * The incremental input data (delta) for the custom tool call. - */ - delta: string; + /** + * The event type identifier. + */ + type: 'response.custom_tool_call_input.delta'; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The index of the output this delta applies to. + */ + output_index: number; + /** + * Unique identifier for the API item associated with this event. + */ + item_id: string; + /** + * The incremental input data (delta) for the custom tool call. + */ + delta: string; }; /** @@ -12472,26 +12872,26 @@ export type ResponseCustomToolCallInputDeltaEvent = { * */ export type ResponseCustomToolCallInputDoneEvent = { - /** - * The event type identifier. - */ - type: 'response.custom_tool_call_input.done'; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The index of the output this event applies to. - */ - output_index: number; - /** - * Unique identifier for the API item associated with this event. - */ - item_id: string; - /** - * The complete input data for the custom tool call. - */ - input: string; + /** + * The event type identifier. + */ + type: 'response.custom_tool_call_input.done'; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The index of the output this event applies to. + */ + output_index: number; + /** + * Unique identifier for the API item associated with this event. + */ + item_id: string; + /** + * The complete input data for the custom tool call. + */ + input: string; }; /** @@ -12499,12 +12899,12 @@ export type ResponseCustomToolCallInputDoneEvent = { * */ export type ResponseError = { - code: ResponseErrorCode; - /** - * A human-readable description of the error. - * - */ - message: string; + code: ResponseErrorCode; + /** + * A human-readable description of the error. + * + */ + message: string; }; /** @@ -12512,60 +12912,60 @@ export type ResponseError = { * */ export const ResponseErrorCode = { - SERVER_ERROR: 'server_error', - RATE_LIMIT_EXCEEDED: 'rate_limit_exceeded', - INVALID_PROMPT: 'invalid_prompt', - VECTOR_STORE_TIMEOUT: 'vector_store_timeout', - INVALID_IMAGE: 'invalid_image', - INVALID_IMAGE_FORMAT: 'invalid_image_format', - INVALID_BASE64_IMAGE: 'invalid_base64_image', - INVALID_IMAGE_URL: 'invalid_image_url', - IMAGE_TOO_LARGE: 'image_too_large', - IMAGE_TOO_SMALL: 'image_too_small', - IMAGE_PARSE_ERROR: 'image_parse_error', - IMAGE_CONTENT_POLICY_VIOLATION: 'image_content_policy_violation', - INVALID_IMAGE_MODE: 'invalid_image_mode', - IMAGE_FILE_TOO_LARGE: 'image_file_too_large', - UNSUPPORTED_IMAGE_MEDIA_TYPE: 'unsupported_image_media_type', - EMPTY_IMAGE_FILE: 'empty_image_file', - FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image', - IMAGE_FILE_NOT_FOUND: 'image_file_not_found' + SERVER_ERROR: 'server_error', + RATE_LIMIT_EXCEEDED: 'rate_limit_exceeded', + INVALID_PROMPT: 'invalid_prompt', + VECTOR_STORE_TIMEOUT: 'vector_store_timeout', + INVALID_IMAGE: 'invalid_image', + INVALID_IMAGE_FORMAT: 'invalid_image_format', + INVALID_BASE64_IMAGE: 'invalid_base64_image', + INVALID_IMAGE_URL: 'invalid_image_url', + IMAGE_TOO_LARGE: 'image_too_large', + IMAGE_TOO_SMALL: 'image_too_small', + IMAGE_PARSE_ERROR: 'image_parse_error', + IMAGE_CONTENT_POLICY_VIOLATION: 'image_content_policy_violation', + INVALID_IMAGE_MODE: 'invalid_image_mode', + IMAGE_FILE_TOO_LARGE: 'image_file_too_large', + UNSUPPORTED_IMAGE_MEDIA_TYPE: 'unsupported_image_media_type', + EMPTY_IMAGE_FILE: 'empty_image_file', + FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image', + IMAGE_FILE_NOT_FOUND: 'image_file_not_found', } as const; /** * The error code for the response. * */ -export type ResponseErrorCode = typeof ResponseErrorCode[keyof typeof ResponseErrorCode]; +export type ResponseErrorCode = (typeof ResponseErrorCode)[keyof typeof ResponseErrorCode]; /** * Emitted when an error occurs. */ export type ResponseErrorEvent = { - /** - * The type of the event. Always `error`. - * - */ - type: 'error'; - /** - * The error code. - * - */ - code: string; - /** - * The error message. - * - */ - message: string; - /** - * The error parameter. - * - */ - param: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `error`. + * + */ + type: 'error'; + /** + * The error code. + * + */ + code: string; + /** + * The error message. + * + */ + message: string; + /** + * The error parameter. + * + */ + param: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -12573,95 +12973,95 @@ export type ResponseErrorEvent = { * */ export type ResponseFailedEvent = { - /** - * The type of the event. Always `response.failed`. - * - */ - type: 'response.failed'; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The response that failed. - * - */ - response: Response; + /** + * The type of the event. Always `response.failed`. + * + */ + type: 'response.failed'; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The response that failed. + * + */ + response: Response; }; /** * Emitted when a file search call is completed (results found). */ export type ResponseFileSearchCallCompletedEvent = { - /** - * The type of the event. Always `response.file_search_call.completed`. - * - */ - type: 'response.file_search_call.completed'; - /** - * The index of the output item that the file search call is initiated. - * - */ - output_index: number; - /** - * The ID of the output item that the file search call is initiated. - * - */ - item_id: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.file_search_call.completed`. + * + */ + type: 'response.file_search_call.completed'; + /** + * The index of the output item that the file search call is initiated. + * + */ + output_index: number; + /** + * The ID of the output item that the file search call is initiated. + * + */ + item_id: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** * Emitted when a file search call is initiated. */ export type ResponseFileSearchCallInProgressEvent = { - /** - * The type of the event. Always `response.file_search_call.in_progress`. - * - */ - type: 'response.file_search_call.in_progress'; - /** - * The index of the output item that the file search call is initiated. - * - */ - output_index: number; - /** - * The ID of the output item that the file search call is initiated. - * - */ - item_id: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.file_search_call.in_progress`. + * + */ + type: 'response.file_search_call.in_progress'; + /** + * The index of the output item that the file search call is initiated. + * + */ + output_index: number; + /** + * The ID of the output item that the file search call is initiated. + * + */ + item_id: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** * Emitted when a file search is currently searching. */ export type ResponseFileSearchCallSearchingEvent = { - /** - * The type of the event. Always `response.file_search_call.searching`. - * - */ - type: 'response.file_search_call.searching'; - /** - * The index of the output item that the file search call is searching. - * - */ - output_index: number; - /** - * The ID of the output item that the file search call is initiated. - * - */ - item_id: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.file_search_call.searching`. + * + */ + type: 'response.file_search_call.searching'; + /** + * The index of the output item that the file search call is searching. + * + */ + output_index: number; + /** + * The ID of the output item that the file search call is initiated. + * + */ + item_id: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -12674,10 +13074,10 @@ export type ResponseFileSearchCallSearchingEvent = { * */ export type ResponseFormatJsonObject = { - /** - * The type of response format being defined. Always `json_object`. - */ - type: 'json_object'; + /** + * The type of response format being defined. Always `json_object`. + */ + type: 'json_object'; }; /** @@ -12688,40 +13088,40 @@ export type ResponseFormatJsonObject = { * */ export type ResponseFormatJsonSchema = { + /** + * The type of response format being defined. Always `json_schema`. + */ + type: 'json_schema'; + /** + * JSON schema + * + * Structured Outputs configuration options, including a JSON Schema. + * + */ + json_schema: { /** - * The type of response format being defined. Always `json_schema`. + * A description of what the response format is for, used by the model to + * determine how to respond in the format. + * */ - type: 'json_schema'; + description?: string; /** - * JSON schema + * The name of the response format. Must be a-z, A-Z, 0-9, or contain + * underscores and dashes, with a maximum length of 64. * - * Structured Outputs configuration options, including a JSON Schema. + */ + name: string; + schema?: ResponseFormatJsonSchemaSchema; + /** + * Whether to enable strict schema adherence when generating the output. + * If set to true, the model will always follow the exact schema defined + * in the `schema` field. Only a subset of JSON Schema is supported when + * `strict` is `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). * */ - json_schema: { - /** - * A description of what the response format is for, used by the model to - * determine how to respond in the format. - * - */ - description?: string; - /** - * The name of the response format. Must be a-z, A-Z, 0-9, or contain - * underscores and dashes, with a maximum length of 64. - * - */ - name: string; - schema?: ResponseFormatJsonSchemaSchema; - /** - * Whether to enable strict schema adherence when generating the output. - * If set to true, the model will always follow the exact schema defined - * in the `schema` field. Only a subset of JSON Schema is supported when - * `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). - * - */ - strict?: boolean; - }; + strict?: boolean; + }; }; /** @@ -12732,7 +13132,7 @@ export type ResponseFormatJsonSchema = { * */ export type ResponseFormatJsonSchemaSchema = { - [key: string]: unknown; + [key: string]: unknown; }; /** @@ -12742,10 +13142,10 @@ export type ResponseFormatJsonSchemaSchema = { * */ export type ResponseFormatText = { - /** - * The type of response format being defined. Always `text`. - */ - type: 'text'; + /** + * The type of response format being defined. Always `text`. + */ + type: 'text'; }; /** @@ -12756,14 +13156,14 @@ export type ResponseFormatText = { * */ export type ResponseFormatTextGrammar = { - /** - * The type of response format being defined. Always `grammar`. - */ - type: 'grammar'; - /** - * The custom grammar for the model to follow. - */ - grammar: string; + /** + * The type of response format being defined. Always `grammar`. + */ + type: 'grammar'; + /** + * The custom grammar for the model to follow. + */ + grammar: string; }; /** @@ -12774,88 +13174,88 @@ export type ResponseFormatTextGrammar = { * */ export type ResponseFormatTextPython = { - /** - * The type of response format being defined. Always `python`. - */ - type: 'python'; + /** + * The type of response format being defined. Always `python`. + */ + type: 'python'; }; /** * Emitted when there is a partial function-call arguments delta. */ export type ResponseFunctionCallArgumentsDeltaEvent = { - /** - * The type of the event. Always `response.function_call_arguments.delta`. - * - */ - type: 'response.function_call_arguments.delta'; - /** - * The ID of the output item that the function-call arguments delta is added to. - * - */ - item_id: string; - /** - * The index of the output item that the function-call arguments delta is added to. - * - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The function-call arguments delta that is added. - * - */ - delta: string; + /** + * The type of the event. Always `response.function_call_arguments.delta`. + * + */ + type: 'response.function_call_arguments.delta'; + /** + * The ID of the output item that the function-call arguments delta is added to. + * + */ + item_id: string; + /** + * The index of the output item that the function-call arguments delta is added to. + * + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The function-call arguments delta that is added. + * + */ + delta: string; }; /** * Emitted when function-call arguments are finalized. */ export type ResponseFunctionCallArgumentsDoneEvent = { - type: 'response.function_call_arguments.done'; - /** - * The ID of the item. - */ - item_id: string; - /** - * The index of the output item. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The function-call arguments. - */ - arguments: string; + type: 'response.function_call_arguments.done'; + /** + * The ID of the item. + */ + item_id: string; + /** + * The index of the output item. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The function-call arguments. + */ + arguments: string; }; /** * ResponseImageGenCallCompletedEvent * * Emitted when an image generation tool call has completed and the final image is available. - * - */ -export type ResponseImageGenCallCompletedEvent = { - /** - * The type of the event. Always 'response.image_generation_call.completed'. - */ - type: 'response.image_generation_call.completed'; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The unique identifier of the image generation item being processed. - */ - item_id: string; + * + */ +export type ResponseImageGenCallCompletedEvent = { + /** + * The type of the event. Always 'response.image_generation_call.completed'. + */ + type: 'response.image_generation_call.completed'; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The unique identifier of the image generation item being processed. + */ + item_id: string; }; /** @@ -12865,22 +13265,22 @@ export type ResponseImageGenCallCompletedEvent = { * */ export type ResponseImageGenCallGeneratingEvent = { - /** - * The type of the event. Always 'response.image_generation_call.generating'. - */ - type: 'response.image_generation_call.generating'; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The unique identifier of the image generation item being processed. - */ - item_id: string; - /** - * The sequence number of the image generation item being processed. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.image_generation_call.generating'. + */ + type: 'response.image_generation_call.generating'; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * The sequence number of the image generation item being processed. + */ + sequence_number: number; }; /** @@ -12890,22 +13290,22 @@ export type ResponseImageGenCallGeneratingEvent = { * */ export type ResponseImageGenCallInProgressEvent = { - /** - * The type of the event. Always 'response.image_generation_call.in_progress'. - */ - type: 'response.image_generation_call.in_progress'; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The unique identifier of the image generation item being processed. - */ - item_id: string; - /** - * The sequence number of the image generation item being processed. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.image_generation_call.in_progress'. + */ + type: 'response.image_generation_call.in_progress'; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * The sequence number of the image generation item being processed. + */ + sequence_number: number; }; /** @@ -12915,50 +13315,50 @@ export type ResponseImageGenCallInProgressEvent = { * */ export type ResponseImageGenCallPartialImageEvent = { - /** - * The type of the event. Always 'response.image_generation_call.partial_image'. - */ - type: 'response.image_generation_call.partial_image'; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The unique identifier of the image generation item being processed. - */ - item_id: string; - /** - * The sequence number of the image generation item being processed. - */ - sequence_number: number; - /** - * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). - */ - partial_image_index: number; - /** - * Base64-encoded partial image data, suitable for rendering as an image. - */ - partial_image_b64: string; + /** + * The type of the event. Always 'response.image_generation_call.partial_image'. + */ + type: 'response.image_generation_call.partial_image'; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * The sequence number of the image generation item being processed. + */ + sequence_number: number; + /** + * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + */ + partial_image_index: number; + /** + * Base64-encoded partial image data, suitable for rendering as an image. + */ + partial_image_b64: string; }; /** * Emitted when the response is in progress. */ export type ResponseInProgressEvent = { - /** - * The type of the event. Always `response.in_progress`. - * - */ - type: 'response.in_progress'; - /** - * The response that is in progress. - * - */ - response: Response; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.in_progress`. + * + */ + type: 'response.in_progress'; + /** + * The response that is in progress. + * + */ + response: Response; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -12966,46 +13366,46 @@ export type ResponseInProgressEvent = { * */ export type ResponseIncompleteEvent = { - /** - * The type of the event. Always `response.incomplete`. - * - */ - type: 'response.incomplete'; - /** - * The response that was incomplete. - * - */ - response: Response; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always `response.incomplete`. + * + */ + type: 'response.incomplete'; + /** + * The response that was incomplete. + * + */ + response: Response; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** * A list of Response items. */ export type ResponseItemList = { - /** - * The type of object returned, must be `list`. - */ - object: 'list'; - /** - * A list of items used to generate this response. - */ - data: Array; - /** - * Whether there are more items available. - */ - has_more: boolean; - /** - * The ID of the first item in the list. - */ - first_id: string; - /** - * The ID of the last item in the list. - */ - last_id: string; + /** + * The type of object returned, must be `list`. + */ + object: 'list'; + /** + * A list of items used to generate this response. + */ + data: Array; + /** + * Whether there are more items available. + */ + has_more: boolean; + /** + * The ID of the first item in the list. + */ + first_id: string; + /** + * The ID of the last item in the list. + */ + last_id: string; }; /** @@ -13015,29 +13415,29 @@ export type ResponseItemList = { * */ export type ResponseLogProb = { + /** + * A possible text token. + */ + token: string; + /** + * The log probability of this token. + * + */ + logprob: number; + /** + * The log probability of the top 20 most likely tokens. + * + */ + top_logprobs?: Array<{ /** * A possible text token. */ - token: string; + token?: string; /** * The log probability of this token. - * - */ - logprob: number; - /** - * The log probability of the top 20 most likely tokens. - * */ - top_logprobs?: Array<{ - /** - * A possible text token. - */ - token?: string; - /** - * The log probability of this token. - */ - logprob?: number; - }>; + logprob?: number; + }>; }; /** @@ -13047,27 +13447,27 @@ export type ResponseLogProb = { * */ export type ResponseMcpCallArgumentsDeltaEvent = { - /** - * The type of the event. Always 'response.mcp_call_arguments.delta'. - */ - type: 'response.mcp_call_arguments.delta'; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The unique identifier of the MCP tool call item being processed. - */ - item_id: string; - /** - * A JSON string containing the partial update to the arguments for the MCP tool call. - * - */ - delta: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_call_arguments.delta'. + */ + type: 'response.mcp_call_arguments.delta'; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The unique identifier of the MCP tool call item being processed. + */ + item_id: string; + /** + * A JSON string containing the partial update to the arguments for the MCP tool call. + * + */ + delta: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13077,27 +13477,27 @@ export type ResponseMcpCallArgumentsDeltaEvent = { * */ export type ResponseMcpCallArgumentsDoneEvent = { - /** - * The type of the event. Always 'response.mcp_call_arguments.done'. - */ - type: 'response.mcp_call_arguments.done'; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The unique identifier of the MCP tool call item being processed. - */ - item_id: string; - /** - * A JSON string containing the finalized arguments for the MCP tool call. - * - */ - arguments: string; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_call_arguments.done'. + */ + type: 'response.mcp_call_arguments.done'; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The unique identifier of the MCP tool call item being processed. + */ + item_id: string; + /** + * A JSON string containing the finalized arguments for the MCP tool call. + * + */ + arguments: string; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13107,22 +13507,22 @@ export type ResponseMcpCallArgumentsDoneEvent = { * */ export type ResponseMcpCallCompletedEvent = { - /** - * The type of the event. Always 'response.mcp_call.completed'. - */ - type: 'response.mcp_call.completed'; - /** - * The ID of the MCP tool call item that completed. - */ - item_id: string; - /** - * The index of the output item that completed. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_call.completed'. + */ + type: 'response.mcp_call.completed'; + /** + * The ID of the MCP tool call item that completed. + */ + item_id: string; + /** + * The index of the output item that completed. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13132,22 +13532,22 @@ export type ResponseMcpCallCompletedEvent = { * */ export type ResponseMcpCallFailedEvent = { - /** - * The type of the event. Always 'response.mcp_call.failed'. - */ - type: 'response.mcp_call.failed'; - /** - * The ID of the MCP tool call item that failed. - */ - item_id: string; - /** - * The index of the output item that failed. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_call.failed'. + */ + type: 'response.mcp_call.failed'; + /** + * The ID of the MCP tool call item that failed. + */ + item_id: string; + /** + * The index of the output item that failed. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13157,22 +13557,22 @@ export type ResponseMcpCallFailedEvent = { * */ export type ResponseMcpCallInProgressEvent = { - /** - * The type of the event. Always 'response.mcp_call.in_progress'. - */ - type: 'response.mcp_call.in_progress'; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The unique identifier of the MCP tool call item being processed. - */ - item_id: string; + /** + * The type of the event. Always 'response.mcp_call.in_progress'. + */ + type: 'response.mcp_call.in_progress'; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The unique identifier of the MCP tool call item being processed. + */ + item_id: string; }; /** @@ -13182,22 +13582,22 @@ export type ResponseMcpCallInProgressEvent = { * */ export type ResponseMcpListToolsCompletedEvent = { - /** - * The type of the event. Always 'response.mcp_list_tools.completed'. - */ - type: 'response.mcp_list_tools.completed'; - /** - * The ID of the MCP tool call item that produced this output. - */ - item_id: string; - /** - * The index of the output item that was processed. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_list_tools.completed'. + */ + type: 'response.mcp_list_tools.completed'; + /** + * The ID of the MCP tool call item that produced this output. + */ + item_id: string; + /** + * The index of the output item that was processed. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13207,22 +13607,22 @@ export type ResponseMcpListToolsCompletedEvent = { * */ export type ResponseMcpListToolsFailedEvent = { - /** - * The type of the event. Always 'response.mcp_list_tools.failed'. - */ - type: 'response.mcp_list_tools.failed'; - /** - * The ID of the MCP tool call item that failed. - */ - item_id: string; - /** - * The index of the output item that failed. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_list_tools.failed'. + */ + type: 'response.mcp_list_tools.failed'; + /** + * The ID of the MCP tool call item that failed. + */ + item_id: string; + /** + * The index of the output item that failed. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13232,22 +13632,22 @@ export type ResponseMcpListToolsFailedEvent = { * */ export type ResponseMcpListToolsInProgressEvent = { - /** - * The type of the event. Always 'response.mcp_list_tools.in_progress'. - */ - type: 'response.mcp_list_tools.in_progress'; - /** - * The ID of the MCP tool call item that is being processed. - */ - item_id: string; - /** - * The index of the output item that is being processed. - */ - output_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; + /** + * The type of the event. Always 'response.mcp_list_tools.in_progress'. + */ + type: 'response.mcp_list_tools.in_progress'; + /** + * The ID of the MCP tool call item that is being processed. + */ + item_id: string; + /** + * The index of the output item that is being processed. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; }; /** @@ -13269,52 +13669,52 @@ export type ResponseModalities = Array<'text' | 'audio'>; * Emitted when a new output item is added. */ export type ResponseOutputItemAddedEvent = { - /** - * The type of the event. Always `response.output_item.added`. - * - */ - type: 'response.output_item.added'; - /** - * The index of the output item that was added. - * - */ - output_index: number; - /** - * The sequence number of this event. - * - */ - sequence_number: number; - /** - * The output item that was added. - * - */ - item: OutputItem; + /** + * The type of the event. Always `response.output_item.added`. + * + */ + type: 'response.output_item.added'; + /** + * The index of the output item that was added. + * + */ + output_index: number; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The output item that was added. + * + */ + item: OutputItem; }; /** * Emitted when an output item is marked done. */ export type ResponseOutputItemDoneEvent = { - /** - * The type of the event. Always `response.output_item.done`. - * - */ - type: 'response.output_item.done'; - /** - * The index of the output item that was marked done. - * - */ - output_index: number; - /** - * The sequence number of this event. - * - */ - sequence_number: number; - /** - * The output item that was marked done. - * - */ - item: OutputItem; + /** + * The type of the event. Always `response.output_item.done`. + * + */ + type: 'response.output_item.done'; + /** + * The index of the output item that was marked done. + * + */ + output_index: number; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The output item that was marked done. + * + */ + item: OutputItem; }; /** @@ -13324,36 +13724,36 @@ export type ResponseOutputItemDoneEvent = { * */ export type ResponseOutputTextAnnotationAddedEvent = { - /** - * The type of the event. Always 'response.output_text.annotation.added'. - */ - type: 'response.output_text.annotation.added'; - /** - * The unique identifier of the item to which the annotation is being added. - */ - item_id: string; - /** - * The index of the output item in the response's output array. - */ - output_index: number; - /** - * The index of the content part within the output item. - */ - content_index: number; - /** - * The index of the annotation within the content part. - */ - annotation_index: number; - /** - * The sequence number of this event. - */ - sequence_number: number; - /** - * The annotation object being added. (See annotation schema for details.) - */ - annotation: { - [key: string]: unknown; - }; + /** + * The type of the event. Always 'response.output_text.annotation.added'. + */ + type: 'response.output_text.annotation.added'; + /** + * The unique identifier of the item to which the annotation is being added. + */ + item_id: string; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * The index of the content part within the output item. + */ + content_index: number; + /** + * The index of the annotation within the content part. + */ + annotation_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The annotation object being added. (See annotation schema for details.) + */ + annotation: { + [key: string]: unknown; + }; }; /** @@ -13365,623 +13765,682 @@ export type ResponseOutputTextAnnotationAddedEvent = { * */ export type ResponsePromptVariables = { - [key: string]: string | InputTextContent | InputImageContent | InputFileContent; + [key: string]: string | InputTextContent | InputImageContent | InputFileContent; }; export type ResponseProperties = { - /** - * The unique ID of the previous response to the model. Use this to - * create multi-turn conversations. Learn more about - * [conversation state](https://platform.openai.com/docs/guides/conversation-state). - * - */ - previous_response_id?: string; - /** - * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI - * offers a wide range of models with different capabilities, performance - * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) - * to browse and compare available models. - * - */ - model?: ModelIdsResponses; - reasoning?: Reasoning; - /** - * Whether to run the model response in the background. - * [Learn more](https://platform.openai.com/docs/guides/background). - * - */ - background?: boolean; - /** - * An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). - * - */ - max_output_tokens?: number; - /** - * The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. - * - */ - max_tool_calls?: number; - /** - * Configuration options for a text response from the model. Can be plain - * text or structured JSON data. Learn more: - * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) - * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) - * - */ - text?: { - format?: TextResponseFormatConfiguration; - verbosity?: Verbosity; - }; - /** - * An array of tools the model may call while generating a response. You - * can specify which tool to use by setting the `tool_choice` parameter. - * - * The two categories of tools you can provide the model are: - * - * - **Built-in tools**: Tools that are provided by OpenAI that extend the - * model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) - * or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - * - **Function calls (custom tools)**: Functions that are defined by you, - * enabling the model to call your own code with strongly typed arguments - * and outputs. Learn more about - * [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use - * custom tools to call your own code. - * - */ - tools?: Array; - /** - * 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. - * - */ - tool_choice?: ToolChoiceOptions | ToolChoiceAllowed | ToolChoiceTypes | ToolChoiceFunction | ToolChoiceMcp | ToolChoiceCustom; - prompt?: Prompt; - /** - * The truncation strategy to use for the model response. - * - `auto`: If the context of this response and previous ones exceeds - * the model's context window size, the model will truncate the - * response to fit the context window by dropping input items in the - * middle of the conversation. - * - `disabled` (default): If a model response will exceed the context window - * size for a model, the request will fail with a 400 error. - * - */ - truncation?: 'auto' | 'disabled'; + /** + * The unique ID of the previous response to the model. Use this to + * create multi-turn conversations. Learn more about + * [conversation state](https://platform.openai.com/docs/guides/conversation-state). + * + */ + previous_response_id?: string; + /** + * Model ID used to generate the response, like `gpt-4o` or `o3`. OpenAI + * offers a wide range of models with different capabilities, performance + * characteristics, and price points. Refer to the [model guide](https://platform.openai.com/docs/models) + * to browse and compare available models. + * + */ + model?: ModelIdsResponses; + reasoning?: Reasoning; + /** + * Whether to run the model response in the background. + * [Learn more](https://platform.openai.com/docs/guides/background). + * + */ + background?: boolean; + /** + * An upper bound for the number of tokens that can be generated for a response, including visible output tokens and [reasoning tokens](https://platform.openai.com/docs/guides/reasoning). + * + */ + max_output_tokens?: number; + /** + * The maximum number of total calls to built-in tools that can be processed in a response. This maximum number applies across all built-in tool calls, not per individual tool. Any further attempts to call a tool by the model will be ignored. + * + */ + max_tool_calls?: number; + /** + * Configuration options for a text response from the model. Can be plain + * text or structured JSON data. Learn more: + * - [Text inputs and outputs](https://platform.openai.com/docs/guides/text) + * - [Structured Outputs](https://platform.openai.com/docs/guides/structured-outputs) + * + */ + text?: { + format?: TextResponseFormatConfiguration; + verbosity?: Verbosity; + }; + /** + * An array of tools the model may call while generating a response. You + * can specify which tool to use by setting the `tool_choice` parameter. + * + * The two categories of tools you can provide the model are: + * + * - **Built-in tools**: Tools that are provided by OpenAI that extend the + * model's capabilities, like [web search](https://platform.openai.com/docs/guides/tools-web-search) + * or [file search](https://platform.openai.com/docs/guides/tools-file-search). Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * - **Function calls (custom tools)**: Functions that are defined by you, + * enabling the model to call your own code with strongly typed arguments + * and outputs. Learn more about + * [function calling](https://platform.openai.com/docs/guides/function-calling). You can also use + * custom tools to call your own code. + * + */ + tools?: Array; + /** + * 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. + * + */ + tool_choice?: + | ToolChoiceOptions + | ToolChoiceAllowed + | ToolChoiceTypes + | ToolChoiceFunction + | ToolChoiceMcp + | ToolChoiceCustom; + prompt?: Prompt; + /** + * The truncation strategy to use for the model response. + * - `auto`: If the context of this response and previous ones exceeds + * the model's context window size, the model will truncate the + * response to fit the context window by dropping input items in the + * middle of the conversation. + * - `disabled` (default): If a model response will exceed the context window + * size for a model, the request will fail with a 400 error. + * + */ + truncation?: 'auto' | 'disabled'; }; /** * ResponseQueuedEvent * * Emitted when a response is queued and waiting to be processed. - * - */ -export type ResponseQueuedEvent = { - /** - * The type of the event. Always 'response.queued'. - */ - type: 'response.queued'; - /** - * The full response object that is queued. - */ - response: Response; - /** - * The sequence number for this event. - */ - sequence_number: number; -}; - -/** - * Emitted when a new reasoning summary part is added. - */ -export type ResponseReasoningSummaryPartAddedEvent = { - /** - * The type of the event. Always `response.reasoning_summary_part.added`. - * - */ - type: 'response.reasoning_summary_part.added'; - /** - * The ID of the item this summary part is associated with. - * - */ - item_id: string; - /** - * The index of the output item this summary part is associated with. - * - */ - output_index: number; - /** - * The index of the summary part within the reasoning summary. - * - */ - summary_index: number; - /** - * The sequence number of this event. - * - */ - sequence_number: number; - /** - * The summary part that was added. - * + * + */ +export type ResponseQueuedEvent = { + /** + * The type of the event. Always 'response.queued'. + */ + type: 'response.queued'; + /** + * The full response object that is queued. + */ + response: Response; + /** + * The sequence number for this event. + */ + sequence_number: number; +}; + +/** + * Emitted when a new reasoning summary part is added. + */ +export type ResponseReasoningSummaryPartAddedEvent = { + /** + * The type of the event. Always `response.reasoning_summary_part.added`. + * + */ + type: 'response.reasoning_summary_part.added'; + /** + * The ID of the item this summary part is associated with. + * + */ + item_id: string; + /** + * The index of the output item this summary part is associated with. + * + */ + output_index: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The summary part that was added. + * + */ + part: { + /** + * The type of the summary part. Always `summary_text`. + */ + type: 'summary_text'; + /** + * The text of the summary part. */ - part: { - /** - * The type of the summary part. Always `summary_text`. - */ - type: 'summary_text'; - /** - * The text of the summary part. - */ - text: string; - }; + text: string; + }; }; /** * Emitted when a reasoning summary part is completed. */ export type ResponseReasoningSummaryPartDoneEvent = { - /** - * The type of the event. Always `response.reasoning_summary_part.done`. - * - */ - type: 'response.reasoning_summary_part.done'; - /** - * The ID of the item this summary part is associated with. - * - */ - item_id: string; - /** - * The index of the output item this summary part is associated with. - * - */ - output_index: number; - /** - * The index of the summary part within the reasoning summary. - * - */ - summary_index: number; - /** - * The sequence number of this event. - * - */ - sequence_number: number; - /** - * The completed summary part. - * + /** + * The type of the event. Always `response.reasoning_summary_part.done`. + * + */ + type: 'response.reasoning_summary_part.done'; + /** + * The ID of the item this summary part is associated with. + * + */ + item_id: string; + /** + * The index of the output item this summary part is associated with. + * + */ + output_index: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The completed summary part. + * + */ + part: { + /** + * The type of the summary part. Always `summary_text`. + */ + type: 'summary_text'; + /** + * The text of the summary part. */ - part: { - /** - * The type of the summary part. Always `summary_text`. - */ - type: 'summary_text'; - /** - * The text of the summary part. - */ - text: string; - }; + text: string; + }; }; /** * Emitted when a delta is added to a reasoning summary text. */ export type ResponseReasoningSummaryTextDeltaEvent = { - /** - * The type of the event. Always `response.reasoning_summary_text.delta`. - * - */ - type: 'response.reasoning_summary_text.delta'; - /** - * The ID of the item this summary text delta is associated with. - * - */ - item_id: string; - /** - * The index of the output item this summary text delta is associated with. - * - */ - output_index: number; - /** - * The index of the summary part within the reasoning summary. - * - */ - summary_index: number; - /** - * The text delta that was added to the summary. - * - */ - delta: string; - /** - * The sequence number of this event. - * - */ - sequence_number: number; + /** + * The type of the event. Always `response.reasoning_summary_text.delta`. + * + */ + type: 'response.reasoning_summary_text.delta'; + /** + * The ID of the item this summary text delta is associated with. + * + */ + item_id: string; + /** + * The index of the output item this summary text delta is associated with. + * + */ + output_index: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The text delta that was added to the summary. + * + */ + delta: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** * Emitted when a reasoning summary text is completed. */ export type ResponseReasoningSummaryTextDoneEvent = { - /** - * The type of the event. Always `response.reasoning_summary_text.done`. - * - */ - type: 'response.reasoning_summary_text.done'; - /** - * The ID of the item this summary text is associated with. - * - */ - item_id: string; - /** - * The index of the output item this summary text is associated with. - * - */ - output_index: number; - /** - * The index of the summary part within the reasoning summary. - * - */ - summary_index: number; - /** - * The full text of the completed reasoning summary. - * - */ - text: string; - /** - * The sequence number of this event. - * - */ - sequence_number: number; + /** + * The type of the event. Always `response.reasoning_summary_text.done`. + * + */ + type: 'response.reasoning_summary_text.done'; + /** + * The ID of the item this summary text is associated with. + * + */ + item_id: string; + /** + * The index of the output item this summary text is associated with. + * + */ + output_index: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The full text of the completed reasoning summary. + * + */ + text: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** * Emitted when a delta is added to a reasoning text. */ export type ResponseReasoningTextDeltaEvent = { - /** - * The type of the event. Always `response.reasoning_text.delta`. - * - */ - type: 'response.reasoning_text.delta'; - /** - * The ID of the item this reasoning text delta is associated with. - * - */ - item_id: string; - /** - * The index of the output item this reasoning text delta is associated with. - * - */ - output_index: number; - /** - * The index of the reasoning content part this delta is associated with. - * - */ - content_index: number; - /** - * The text delta that was added to the reasoning content. - * - */ - delta: string; - /** - * The sequence number of this event. - * - */ - sequence_number: number; + /** + * The type of the event. Always `response.reasoning_text.delta`. + * + */ + type: 'response.reasoning_text.delta'; + /** + * The ID of the item this reasoning text delta is associated with. + * + */ + item_id: string; + /** + * The index of the output item this reasoning text delta is associated with. + * + */ + output_index: number; + /** + * The index of the reasoning content part this delta is associated with. + * + */ + content_index: number; + /** + * The text delta that was added to the reasoning content. + * + */ + delta: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** * Emitted when a reasoning text is completed. */ export type ResponseReasoningTextDoneEvent = { - /** - * The type of the event. Always `response.reasoning_text.done`. - * - */ - type: 'response.reasoning_text.done'; - /** - * The ID of the item this reasoning text is associated with. - * - */ - item_id: string; - /** - * The index of the output item this reasoning text is associated with. - * - */ - output_index: number; - /** - * The index of the reasoning content part. - * - */ - content_index: number; - /** - * The full text of the completed reasoning content. - * - */ - text: string; - /** - * The sequence number of this event. - * - */ - sequence_number: number; + /** + * The type of the event. Always `response.reasoning_text.done`. + * + */ + type: 'response.reasoning_text.done'; + /** + * The ID of the item this reasoning text is associated with. + * + */ + item_id: string; + /** + * The index of the output item this reasoning text is associated with. + * + */ + output_index: number; + /** + * The index of the reasoning content part. + * + */ + content_index: number; + /** + * The full text of the completed reasoning content. + * + */ + text: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** * Emitted when there is a partial refusal text. */ export type ResponseRefusalDeltaEvent = { - /** - * The type of the event. Always `response.refusal.delta`. - * - */ - type: 'response.refusal.delta'; - /** - * The ID of the output item that the refusal text is added to. - * - */ - item_id: string; - /** - * The index of the output item that the refusal text is added to. - * - */ - output_index: number; - /** - * The index of the content part that the refusal text is added to. - * - */ - content_index: number; - /** - * The refusal text that is added. - * - */ - delta: string; - /** - * The sequence number of this event. - * - */ - sequence_number: number; + /** + * The type of the event. Always `response.refusal.delta`. + * + */ + type: 'response.refusal.delta'; + /** + * The ID of the output item that the refusal text is added to. + * + */ + item_id: string; + /** + * The index of the output item that the refusal text is added to. + * + */ + output_index: number; + /** + * The index of the content part that the refusal text is added to. + * + */ + content_index: number; + /** + * The refusal text that is added. + * + */ + delta: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** * Emitted when refusal text is finalized. */ export type ResponseRefusalDoneEvent = { - /** - * The type of the event. Always `response.refusal.done`. - * - */ - type: 'response.refusal.done'; - /** - * The ID of the output item that the refusal text is finalized. - * - */ - item_id: string; - /** - * The index of the output item that the refusal text is finalized. - * - */ - output_index: number; - /** - * The index of the content part that the refusal text is finalized. - * - */ - content_index: number; - /** - * The refusal text that is finalized. - * - */ - refusal: string; - /** - * The sequence number of this event. - * - */ - sequence_number: number; -}; - -export type ResponseStreamEvent = ({ - type?: 'ResponseAudioDeltaEvent'; -} & ResponseAudioDeltaEvent) | ({ - type?: 'ResponseAudioDoneEvent'; -} & ResponseAudioDoneEvent) | ({ - type?: 'ResponseAudioTranscriptDeltaEvent'; -} & ResponseAudioTranscriptDeltaEvent) | ({ - type?: 'ResponseAudioTranscriptDoneEvent'; -} & ResponseAudioTranscriptDoneEvent) | ({ - type?: 'ResponseCodeInterpreterCallCodeDeltaEvent'; -} & ResponseCodeInterpreterCallCodeDeltaEvent) | ({ - type?: 'ResponseCodeInterpreterCallCodeDoneEvent'; -} & ResponseCodeInterpreterCallCodeDoneEvent) | ({ - type?: 'ResponseCodeInterpreterCallCompletedEvent'; -} & ResponseCodeInterpreterCallCompletedEvent) | ({ - type?: 'ResponseCodeInterpreterCallInProgressEvent'; -} & ResponseCodeInterpreterCallInProgressEvent) | ({ - type?: 'ResponseCodeInterpreterCallInterpretingEvent'; -} & ResponseCodeInterpreterCallInterpretingEvent) | ({ - type?: 'ResponseCompletedEvent'; -} & ResponseCompletedEvent) | ({ - type?: 'ResponseContentPartAddedEvent'; -} & ResponseContentPartAddedEvent) | ({ - type?: 'ResponseContentPartDoneEvent'; -} & ResponseContentPartDoneEvent) | ({ - type?: 'ResponseCreatedEvent'; -} & ResponseCreatedEvent) | ({ - type?: 'ResponseErrorEvent'; -} & ResponseErrorEvent) | ({ - type?: 'ResponseFileSearchCallCompletedEvent'; -} & ResponseFileSearchCallCompletedEvent) | ({ - type?: 'ResponseFileSearchCallInProgressEvent'; -} & ResponseFileSearchCallInProgressEvent) | ({ - type?: 'ResponseFileSearchCallSearchingEvent'; -} & ResponseFileSearchCallSearchingEvent) | ({ - type?: 'ResponseFunctionCallArgumentsDeltaEvent'; -} & ResponseFunctionCallArgumentsDeltaEvent) | ({ - type?: 'ResponseFunctionCallArgumentsDoneEvent'; -} & ResponseFunctionCallArgumentsDoneEvent) | ({ - type?: 'ResponseInProgressEvent'; -} & ResponseInProgressEvent) | ({ - type?: 'ResponseFailedEvent'; -} & ResponseFailedEvent) | ({ - type?: 'ResponseIncompleteEvent'; -} & ResponseIncompleteEvent) | ({ - type?: 'ResponseOutputItemAddedEvent'; -} & ResponseOutputItemAddedEvent) | ({ - type?: 'ResponseOutputItemDoneEvent'; -} & ResponseOutputItemDoneEvent) | ({ - type?: 'ResponseReasoningSummaryPartAddedEvent'; -} & ResponseReasoningSummaryPartAddedEvent) | ({ - type?: 'ResponseReasoningSummaryPartDoneEvent'; -} & ResponseReasoningSummaryPartDoneEvent) | ({ - type?: 'ResponseReasoningSummaryTextDeltaEvent'; -} & ResponseReasoningSummaryTextDeltaEvent) | ({ - type?: 'ResponseReasoningSummaryTextDoneEvent'; -} & ResponseReasoningSummaryTextDoneEvent) | ({ - type?: 'ResponseReasoningTextDeltaEvent'; -} & ResponseReasoningTextDeltaEvent) | ({ - type?: 'ResponseReasoningTextDoneEvent'; -} & ResponseReasoningTextDoneEvent) | ({ - type?: 'ResponseRefusalDeltaEvent'; -} & ResponseRefusalDeltaEvent) | ({ - type?: 'ResponseRefusalDoneEvent'; -} & ResponseRefusalDoneEvent) | ({ - type?: 'ResponseTextDeltaEvent'; -} & ResponseTextDeltaEvent) | ({ - type?: 'ResponseTextDoneEvent'; -} & ResponseTextDoneEvent) | ({ - type?: 'ResponseWebSearchCallCompletedEvent'; -} & ResponseWebSearchCallCompletedEvent) | ({ - type?: 'ResponseWebSearchCallInProgressEvent'; -} & ResponseWebSearchCallInProgressEvent) | ({ - type?: 'ResponseWebSearchCallSearchingEvent'; -} & ResponseWebSearchCallSearchingEvent) | ({ - type?: 'ResponseImageGenCallCompletedEvent'; -} & ResponseImageGenCallCompletedEvent) | ({ - type?: 'ResponseImageGenCallGeneratingEvent'; -} & ResponseImageGenCallGeneratingEvent) | ({ - type?: 'ResponseImageGenCallInProgressEvent'; -} & ResponseImageGenCallInProgressEvent) | ({ - type?: 'ResponseImageGenCallPartialImageEvent'; -} & ResponseImageGenCallPartialImageEvent) | ({ - type?: 'ResponseMCPCallArgumentsDeltaEvent'; -} & ResponseMcpCallArgumentsDeltaEvent) | ({ - type?: 'ResponseMCPCallArgumentsDoneEvent'; -} & ResponseMcpCallArgumentsDoneEvent) | ({ - type?: 'ResponseMCPCallCompletedEvent'; -} & ResponseMcpCallCompletedEvent) | ({ - type?: 'ResponseMCPCallFailedEvent'; -} & ResponseMcpCallFailedEvent) | ({ - type?: 'ResponseMCPCallInProgressEvent'; -} & ResponseMcpCallInProgressEvent) | ({ - type?: 'ResponseMCPListToolsCompletedEvent'; -} & ResponseMcpListToolsCompletedEvent) | ({ - type?: 'ResponseMCPListToolsFailedEvent'; -} & ResponseMcpListToolsFailedEvent) | ({ - type?: 'ResponseMCPListToolsInProgressEvent'; -} & ResponseMcpListToolsInProgressEvent) | ({ - type?: 'ResponseOutputTextAnnotationAddedEvent'; -} & ResponseOutputTextAnnotationAddedEvent) | ({ - type?: 'ResponseQueuedEvent'; -} & ResponseQueuedEvent) | ({ - type?: 'ResponseCustomToolCallInputDeltaEvent'; -} & ResponseCustomToolCallInputDeltaEvent) | ({ - type?: 'ResponseCustomToolCallInputDoneEvent'; -} & ResponseCustomToolCallInputDoneEvent); + /** + * The type of the event. Always `response.refusal.done`. + * + */ + type: 'response.refusal.done'; + /** + * The ID of the output item that the refusal text is finalized. + * + */ + item_id: string; + /** + * The index of the output item that the refusal text is finalized. + * + */ + output_index: number; + /** + * The index of the content part that the refusal text is finalized. + * + */ + content_index: number; + /** + * The refusal text that is finalized. + * + */ + refusal: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; +}; + +export type ResponseStreamEvent = + | ({ + type?: 'ResponseAudioDeltaEvent'; + } & ResponseAudioDeltaEvent) + | ({ + type?: 'ResponseAudioDoneEvent'; + } & ResponseAudioDoneEvent) + | ({ + type?: 'ResponseAudioTranscriptDeltaEvent'; + } & ResponseAudioTranscriptDeltaEvent) + | ({ + type?: 'ResponseAudioTranscriptDoneEvent'; + } & ResponseAudioTranscriptDoneEvent) + | ({ + type?: 'ResponseCodeInterpreterCallCodeDeltaEvent'; + } & ResponseCodeInterpreterCallCodeDeltaEvent) + | ({ + type?: 'ResponseCodeInterpreterCallCodeDoneEvent'; + } & ResponseCodeInterpreterCallCodeDoneEvent) + | ({ + type?: 'ResponseCodeInterpreterCallCompletedEvent'; + } & ResponseCodeInterpreterCallCompletedEvent) + | ({ + type?: 'ResponseCodeInterpreterCallInProgressEvent'; + } & ResponseCodeInterpreterCallInProgressEvent) + | ({ + type?: 'ResponseCodeInterpreterCallInterpretingEvent'; + } & ResponseCodeInterpreterCallInterpretingEvent) + | ({ + type?: 'ResponseCompletedEvent'; + } & ResponseCompletedEvent) + | ({ + type?: 'ResponseContentPartAddedEvent'; + } & ResponseContentPartAddedEvent) + | ({ + type?: 'ResponseContentPartDoneEvent'; + } & ResponseContentPartDoneEvent) + | ({ + type?: 'ResponseCreatedEvent'; + } & ResponseCreatedEvent) + | ({ + type?: 'ResponseErrorEvent'; + } & ResponseErrorEvent) + | ({ + type?: 'ResponseFileSearchCallCompletedEvent'; + } & ResponseFileSearchCallCompletedEvent) + | ({ + type?: 'ResponseFileSearchCallInProgressEvent'; + } & ResponseFileSearchCallInProgressEvent) + | ({ + type?: 'ResponseFileSearchCallSearchingEvent'; + } & ResponseFileSearchCallSearchingEvent) + | ({ + type?: 'ResponseFunctionCallArgumentsDeltaEvent'; + } & ResponseFunctionCallArgumentsDeltaEvent) + | ({ + type?: 'ResponseFunctionCallArgumentsDoneEvent'; + } & ResponseFunctionCallArgumentsDoneEvent) + | ({ + type?: 'ResponseInProgressEvent'; + } & ResponseInProgressEvent) + | ({ + type?: 'ResponseFailedEvent'; + } & ResponseFailedEvent) + | ({ + type?: 'ResponseIncompleteEvent'; + } & ResponseIncompleteEvent) + | ({ + type?: 'ResponseOutputItemAddedEvent'; + } & ResponseOutputItemAddedEvent) + | ({ + type?: 'ResponseOutputItemDoneEvent'; + } & ResponseOutputItemDoneEvent) + | ({ + type?: 'ResponseReasoningSummaryPartAddedEvent'; + } & ResponseReasoningSummaryPartAddedEvent) + | ({ + type?: 'ResponseReasoningSummaryPartDoneEvent'; + } & ResponseReasoningSummaryPartDoneEvent) + | ({ + type?: 'ResponseReasoningSummaryTextDeltaEvent'; + } & ResponseReasoningSummaryTextDeltaEvent) + | ({ + type?: 'ResponseReasoningSummaryTextDoneEvent'; + } & ResponseReasoningSummaryTextDoneEvent) + | ({ + type?: 'ResponseReasoningTextDeltaEvent'; + } & ResponseReasoningTextDeltaEvent) + | ({ + type?: 'ResponseReasoningTextDoneEvent'; + } & ResponseReasoningTextDoneEvent) + | ({ + type?: 'ResponseRefusalDeltaEvent'; + } & ResponseRefusalDeltaEvent) + | ({ + type?: 'ResponseRefusalDoneEvent'; + } & ResponseRefusalDoneEvent) + | ({ + type?: 'ResponseTextDeltaEvent'; + } & ResponseTextDeltaEvent) + | ({ + type?: 'ResponseTextDoneEvent'; + } & ResponseTextDoneEvent) + | ({ + type?: 'ResponseWebSearchCallCompletedEvent'; + } & ResponseWebSearchCallCompletedEvent) + | ({ + type?: 'ResponseWebSearchCallInProgressEvent'; + } & ResponseWebSearchCallInProgressEvent) + | ({ + type?: 'ResponseWebSearchCallSearchingEvent'; + } & ResponseWebSearchCallSearchingEvent) + | ({ + type?: 'ResponseImageGenCallCompletedEvent'; + } & ResponseImageGenCallCompletedEvent) + | ({ + type?: 'ResponseImageGenCallGeneratingEvent'; + } & ResponseImageGenCallGeneratingEvent) + | ({ + type?: 'ResponseImageGenCallInProgressEvent'; + } & ResponseImageGenCallInProgressEvent) + | ({ + type?: 'ResponseImageGenCallPartialImageEvent'; + } & ResponseImageGenCallPartialImageEvent) + | ({ + type?: 'ResponseMCPCallArgumentsDeltaEvent'; + } & ResponseMcpCallArgumentsDeltaEvent) + | ({ + type?: 'ResponseMCPCallArgumentsDoneEvent'; + } & ResponseMcpCallArgumentsDoneEvent) + | ({ + type?: 'ResponseMCPCallCompletedEvent'; + } & ResponseMcpCallCompletedEvent) + | ({ + type?: 'ResponseMCPCallFailedEvent'; + } & ResponseMcpCallFailedEvent) + | ({ + type?: 'ResponseMCPCallInProgressEvent'; + } & ResponseMcpCallInProgressEvent) + | ({ + type?: 'ResponseMCPListToolsCompletedEvent'; + } & ResponseMcpListToolsCompletedEvent) + | ({ + type?: 'ResponseMCPListToolsFailedEvent'; + } & ResponseMcpListToolsFailedEvent) + | ({ + type?: 'ResponseMCPListToolsInProgressEvent'; + } & ResponseMcpListToolsInProgressEvent) + | ({ + type?: 'ResponseOutputTextAnnotationAddedEvent'; + } & ResponseOutputTextAnnotationAddedEvent) + | ({ + type?: 'ResponseQueuedEvent'; + } & ResponseQueuedEvent) + | ({ + type?: 'ResponseCustomToolCallInputDeltaEvent'; + } & ResponseCustomToolCallInputDeltaEvent) + | ({ + type?: 'ResponseCustomToolCallInputDoneEvent'; + } & ResponseCustomToolCallInputDoneEvent); /** * Options for streaming responses. Only set this when you set `stream: true`. * */ export type ResponseStreamOptions = { - /** - * When true, stream obfuscation will be enabled. Stream obfuscation adds - * random characters to an `obfuscation` field on streaming delta events to - * normalize payload sizes as a mitigation to certain side-channel attacks. - * These obfuscation fields are included by default, but add a small amount - * of overhead to the data stream. You can set `include_obfuscation` to - * false to optimize for bandwidth if you trust the network links between - * your application and the OpenAI API. - * - */ - include_obfuscation?: boolean; + /** + * When true, stream obfuscation will be enabled. Stream obfuscation adds + * random characters to an `obfuscation` field on streaming delta events to + * normalize payload sizes as a mitigation to certain side-channel attacks. + * These obfuscation fields are included by default, but add a small amount + * of overhead to the data stream. You can set `include_obfuscation` to + * false to optimize for bandwidth if you trust the network links between + * your application and the OpenAI API. + * + */ + include_obfuscation?: boolean; }; /** * Emitted when there is an additional text delta. */ export type ResponseTextDeltaEvent = { - /** - * The type of the event. Always `response.output_text.delta`. - * - */ - type: 'response.output_text.delta'; - /** - * The ID of the output item that the text delta was added to. - * - */ - item_id: string; - /** - * The index of the output item that the text delta was added to. - * - */ - output_index: number; - /** - * The index of the content part that the text delta was added to. - * - */ - content_index: number; - /** - * The text delta that was added. - * - */ - delta: string; - /** - * The sequence number for this event. - */ - sequence_number: number; - /** - * The log probabilities of the tokens in the delta. - * - */ - logprobs: Array; + /** + * The type of the event. Always `response.output_text.delta`. + * + */ + type: 'response.output_text.delta'; + /** + * The ID of the output item that the text delta was added to. + * + */ + item_id: string; + /** + * The index of the output item that the text delta was added to. + * + */ + output_index: number; + /** + * The index of the content part that the text delta was added to. + * + */ + content_index: number; + /** + * The text delta that was added. + * + */ + delta: string; + /** + * The sequence number for this event. + */ + sequence_number: number; + /** + * The log probabilities of the tokens in the delta. + * + */ + logprobs: Array; }; /** * Emitted when text content is finalized. */ export type ResponseTextDoneEvent = { - /** - * The type of the event. Always `response.output_text.done`. - * - */ - type: 'response.output_text.done'; - /** - * The ID of the output item that the text content is finalized. - * - */ - item_id: string; - /** - * The index of the output item that the text content is finalized. - * - */ - output_index: number; - /** - * The index of the content part that the text content is finalized. - * - */ - content_index: number; - /** - * The text content that is finalized. - * - */ - text: string; - /** - * The sequence number for this event. - */ - sequence_number: number; - /** - * The log probabilities of the tokens in the delta. - * - */ - logprobs: Array; + /** + * The type of the event. Always `response.output_text.done`. + * + */ + type: 'response.output_text.done'; + /** + * The ID of the output item that the text content is finalized. + * + */ + item_id: string; + /** + * The index of the output item that the text content is finalized. + * + */ + output_index: number; + /** + * The index of the content part that the text content is finalized. + * + */ + content_index: number; + /** + * The text content that is finalized. + * + */ + text: string; + /** + * The sequence number for this event. + */ + sequence_number: number; + /** + * The log probabilities of the tokens in the delta. + * + */ + logprobs: Array; }; /** @@ -13990,203 +14449,208 @@ export type ResponseTextDoneEvent = { * */ export type ResponseUsage = { + /** + * The number of input tokens. + */ + input_tokens: number; + /** + * A detailed breakdown of the input tokens. + */ + input_tokens_details: { /** - * The number of input tokens. - */ - input_tokens: number; - /** - * A detailed breakdown of the input tokens. - */ - input_tokens_details: { - /** - * The number of tokens that were retrieved from the cache. - * [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). - * - */ - cached_tokens: number; - }; - /** - * The number of output tokens. - */ - output_tokens: number; - /** - * A detailed breakdown of the output tokens. + * The number of tokens that were retrieved from the cache. + * [More on prompt caching](https://platform.openai.com/docs/guides/prompt-caching). + * */ - output_tokens_details: { - /** - * The number of reasoning tokens. - */ - reasoning_tokens: number; - }; + cached_tokens: number; + }; + /** + * The number of output tokens. + */ + output_tokens: number; + /** + * A detailed breakdown of the output tokens. + */ + output_tokens_details: { /** - * The total number of tokens used. + * The number of reasoning tokens. */ - total_tokens: number; + reasoning_tokens: number; + }; + /** + * The total number of tokens used. + */ + total_tokens: number; }; /** * Emitted when a web search call is completed. */ export type ResponseWebSearchCallCompletedEvent = { - /** - * The type of the event. Always `response.web_search_call.completed`. - * - */ - type: 'response.web_search_call.completed'; - /** - * The index of the output item that the web search call is associated with. - * - */ - output_index: number; - /** - * Unique ID for the output item associated with the web search call. - * - */ - item_id: string; - /** - * The sequence number of the web search call being processed. - */ - sequence_number: number; + /** + * The type of the event. Always `response.web_search_call.completed`. + * + */ + type: 'response.web_search_call.completed'; + /** + * The index of the output item that the web search call is associated with. + * + */ + output_index: number; + /** + * Unique ID for the output item associated with the web search call. + * + */ + item_id: string; + /** + * The sequence number of the web search call being processed. + */ + sequence_number: number; }; /** * Emitted when a web search call is initiated. */ export type ResponseWebSearchCallInProgressEvent = { - /** - * The type of the event. Always `response.web_search_call.in_progress`. - * - */ - type: 'response.web_search_call.in_progress'; - /** - * The index of the output item that the web search call is associated with. - * - */ - output_index: number; - /** - * Unique ID for the output item associated with the web search call. - * - */ - item_id: string; - /** - * The sequence number of the web search call being processed. - */ - sequence_number: number; + /** + * The type of the event. Always `response.web_search_call.in_progress`. + * + */ + type: 'response.web_search_call.in_progress'; + /** + * The index of the output item that the web search call is associated with. + * + */ + output_index: number; + /** + * Unique ID for the output item associated with the web search call. + * + */ + item_id: string; + /** + * The sequence number of the web search call being processed. + */ + sequence_number: number; }; /** * Emitted when a web search call is executing. */ export type ResponseWebSearchCallSearchingEvent = { - /** - * The type of the event. Always `response.web_search_call.searching`. - * - */ - type: 'response.web_search_call.searching'; - /** - * The index of the output item that the web search call is associated with. - * - */ - output_index: number; - /** - * Unique ID for the output item associated with the web search call. - * - */ - item_id: string; - /** - * The sequence number of the web search call being processed. - */ - sequence_number: number; + /** + * The type of the event. Always `response.web_search_call.searching`. + * + */ + type: 'response.web_search_call.searching'; + /** + * The index of the output item that the web search call is associated with. + * + */ + output_index: number; + /** + * Unique ID for the output item associated with the web search call. + * + */ + item_id: string; + /** + * The sequence number of the web search call being processed. + */ + sequence_number: number; }; /** * Usage statistics related to the run. This value will be `null` if the run is not in a terminal state (i.e. `in_progress`, `queued`, etc.). */ export type RunCompletionUsage = { - /** - * Number of completion tokens used over the course of the run. - */ - completion_tokens: number; - /** - * Number of prompt tokens used over the course of the run. - */ - prompt_tokens: number; - /** - * Total number of tokens used (prompt + completion). - */ - total_tokens: number; + /** + * Number of completion tokens used over the course of the run. + */ + completion_tokens: number; + /** + * Number of prompt tokens used over the course of the run. + */ + prompt_tokens: number; + /** + * Total number of tokens used (prompt + completion). + */ + total_tokens: number; }; /** * RunGraderRequest */ export type RunGraderRequest = { - /** - * The grader used for the fine-tuning job. - */ - grader: ({ + /** + * The grader used for the fine-tuning job. + */ + grader: + | ({ type?: 'GraderStringCheck'; - } & GraderStringCheck) | ({ + } & GraderStringCheck) + | ({ type?: 'GraderTextSimilarity'; - } & GraderTextSimilarity) | ({ + } & GraderTextSimilarity) + | ({ type?: 'GraderPython'; - } & GraderPython) | ({ + } & GraderPython) + | ({ type?: 'GraderScoreModel'; - } & GraderScoreModel) | ({ + } & GraderScoreModel) + | ({ type?: 'GraderMulti'; - } & GraderMulti); - /** - * The dataset item provided to the grader. This will be used to populate - * the `item` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. - * - */ - item?: { - [key: string]: unknown; - }; - /** - * The model sample to be evaluated. This value will be used to populate - * the `sample` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. - * The `output_json` variable will be populated if the model sample is a - * valid JSON string. - * - */ - model_sample: string; + } & GraderMulti); + /** + * The dataset item provided to the grader. This will be used to populate + * the `item` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. + * + */ + item?: { + [key: string]: unknown; + }; + /** + * The model sample to be evaluated. This value will be used to populate + * the `sample` namespace. See [the guide](https://platform.openai.com/docs/guides/graders) for more details. + * The `output_json` variable will be populated if the model sample is a + * valid JSON string. + * + */ + model_sample: string; }; - -export type RunGraderResponse = { - reward: number; - metadata: { - name: string; - type: string; - errors: { - formula_parse_error: boolean; - sample_parse_error: boolean; - truncated_observation_error: boolean; - unresponsive_reward_error: boolean; - invalid_variable_error: boolean; - other_error: boolean; - python_grader_server_error: boolean; - python_grader_server_error_type: string; - python_grader_runtime_error: boolean; - python_grader_runtime_error_details: string; - model_grader_server_error: boolean; - model_grader_refusal_error: boolean; - model_grader_parse_error: boolean; - model_grader_server_error_details: string; - }; - execution_time: number; - scores: { - [key: string]: unknown; - }; - token_usage: number; - sampled_model_name: string; - }; - sub_rewards: { - [key: string]: unknown; - }; - model_grader_token_usage_per_model: { - [key: string]: unknown; - }; + +export type RunGraderResponse = { + reward: number; + metadata: { + name: string; + type: string; + errors: { + formula_parse_error: boolean; + sample_parse_error: boolean; + truncated_observation_error: boolean; + unresponsive_reward_error: boolean; + invalid_variable_error: boolean; + other_error: boolean; + python_grader_server_error: boolean; + python_grader_server_error_type: string; + python_grader_runtime_error: boolean; + python_grader_runtime_error_details: string; + model_grader_server_error: boolean; + model_grader_refusal_error: boolean; + model_grader_parse_error: boolean; + model_grader_server_error_details: string; + }; + execution_time: number; + scores: { + [key: string]: unknown; + }; + token_usage: number; + sampled_model_name: string; + }; + sub_rewards: { + [key: string]: unknown; + }; + model_grader_token_usage_per_model: { + [key: string]: unknown; + }; }; /** @@ -14195,141 +14659,141 @@ export type RunGraderResponse = { * Represents an execution run on a [thread](https://platform.openai.com/docs/api-reference/threads). */ export type RunObject = { + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `thread.run`. + */ + object: 'thread.run'; + /** + * The Unix timestamp (in seconds) for when the run was created. + */ + created_at: number; + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + */ + thread_id: string; + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + */ + assistant_id: string; + status: RunStatus; + /** + * Details on the action required to continue the run. Will be `null` if no action is required. + */ + required_action: { + /** + * For now, this is always `submit_tool_outputs`. + */ + type: 'submit_tool_outputs'; + /** + * Details on the tool outputs needed for this run to continue. + */ + submit_tool_outputs: { + /** + * A list of the relevant tool calls. + */ + tool_calls: Array; + }; + }; + /** + * The last error associated with this run. Will be `null` if there are no errors. + */ + last_error: { + /** + * One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. + */ + code: 'server_error' | 'rate_limit_exceeded' | 'invalid_prompt'; /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `thread.run`. - */ - object: 'thread.run'; - /** - * The Unix timestamp (in seconds) for when the run was created. - */ - created_at: number; - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. - */ - thread_id: string; - /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - */ - assistant_id: string; - status: RunStatus; - /** - * Details on the action required to continue the run. Will be `null` if no action is required. - */ - required_action: { - /** - * For now, this is always `submit_tool_outputs`. - */ - type: 'submit_tool_outputs'; - /** - * Details on the tool outputs needed for this run to continue. - */ - submit_tool_outputs: { - /** - * A list of the relevant tool calls. - */ - tool_calls: Array; - }; - }; - /** - * The last error associated with this run. Will be `null` if there are no errors. - */ - last_error: { - /** - * One of `server_error`, `rate_limit_exceeded`, or `invalid_prompt`. - */ - code: 'server_error' | 'rate_limit_exceeded' | 'invalid_prompt'; - /** - * A human-readable description of the error. - */ - message: string; - }; - /** - * The Unix timestamp (in seconds) for when the run will expire. - */ - expires_at: number; - /** - * The Unix timestamp (in seconds) for when the run was started. - */ - started_at: number; - /** - * The Unix timestamp (in seconds) for when the run was cancelled. - */ - cancelled_at: number; - /** - * The Unix timestamp (in seconds) for when the run failed. - */ - failed_at: number; - /** - * The Unix timestamp (in seconds) for when the run was completed. - */ - completed_at: number; - /** - * Details on why the run is incomplete. Will be `null` if the run is not incomplete. - */ - incomplete_details: { - /** - * The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. - */ - reason?: 'max_completion_tokens' | 'max_prompt_tokens'; - }; - /** - * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - */ - model: string; - /** - * The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - */ - instructions: string; - /** - * The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - */ - tools: Array; - metadata: Metadata; - usage: RunCompletionUsage; - /** - * The sampling temperature used for this run. If not set, defaults to 1. - */ - temperature?: number; - /** - * The nucleus sampling value used for this run. If not set, defaults to 1. - */ - top_p?: number; - /** - * The maximum number of prompt tokens specified to have been used over the course of the run. - * - */ - max_prompt_tokens: number; - /** - * The maximum number of completion tokens specified to have been used over the course of the run. - * + * A human-readable description of the error. */ - max_completion_tokens: number; - truncation_strategy: TruncationObject & unknown; - tool_choice: AssistantsApiToolChoiceOption & unknown; - parallel_tool_calls: ParallelToolCalls; - response_format: AssistantsApiResponseFormatOption; + message: string; + }; + /** + * The Unix timestamp (in seconds) for when the run will expire. + */ + expires_at: number; + /** + * The Unix timestamp (in seconds) for when the run was started. + */ + started_at: number; + /** + * The Unix timestamp (in seconds) for when the run was cancelled. + */ + cancelled_at: number; + /** + * The Unix timestamp (in seconds) for when the run failed. + */ + failed_at: number; + /** + * The Unix timestamp (in seconds) for when the run was completed. + */ + completed_at: number; + /** + * Details on why the run is incomplete. Will be `null` if the run is not incomplete. + */ + incomplete_details: { + /** + * The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + */ + reason?: 'max_completion_tokens' | 'max_prompt_tokens'; + }; + /** + * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + */ + model: string; + /** + * The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + */ + instructions: string; + /** + * The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + */ + tools: Array; + metadata: Metadata; + usage: RunCompletionUsage; + /** + * The sampling temperature used for this run. If not set, defaults to 1. + */ + temperature?: number; + /** + * The nucleus sampling value used for this run. If not set, defaults to 1. + */ + top_p?: number; + /** + * The maximum number of prompt tokens specified to have been used over the course of the run. + * + */ + max_prompt_tokens: number; + /** + * The maximum number of completion tokens specified to have been used over the course of the run. + * + */ + max_completion_tokens: number; + truncation_strategy: TruncationObject & unknown; + tool_choice: AssistantsApiToolChoiceOption & unknown; + parallel_tool_calls: ParallelToolCalls; + response_format: AssistantsApiResponseFormatOption; }; /** * Usage statistics related to the run step. This value will be `null` while the run step's status is `in_progress`. */ export type RunStepCompletionUsage = { - /** - * Number of completion tokens used over the course of the run step. - */ - completion_tokens: number; - /** - * Number of prompt tokens used over the course of the run step. - */ - prompt_tokens: number; - /** - * Total number of tokens used (prompt + completion). - */ - total_tokens: number; + /** + * Number of completion tokens used over the course of the run step. + */ + completion_tokens: number; + /** + * Number of prompt tokens used over the course of the run step. + */ + prompt_tokens: number; + /** + * Total number of tokens used (prompt + completion). + */ + total_tokens: number; }; /** @@ -14339,15 +14803,15 @@ export type RunStepCompletionUsage = { * */ export type RunStepDeltaObject = { - /** - * The identifier of the run step, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `thread.run.step.delta`. - */ - object: 'thread.run.step.delta'; - delta: RunStepDeltaObjectDelta; + /** + * The identifier of the run step, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `thread.run.step.delta`. + */ + object: 'thread.run.step.delta'; + delta: RunStepDeltaObjectDelta; }; /** @@ -14356,16 +14820,16 @@ export type RunStepDeltaObject = { * Details of the message creation by the run step. */ export type RunStepDeltaStepDetailsMessageCreationObject = { + /** + * Always `message_creation`. + */ + type: 'message_creation'; + message_creation?: { /** - * Always `message_creation`. + * The ID of the message that was created by this run step. */ - type: 'message_creation'; - message_creation?: { - /** - * The ID of the message that was created by this run step. - */ - message_id?: string; - }; + message_id?: string; + }; }; /** @@ -14374,55 +14838,58 @@ export type RunStepDeltaStepDetailsMessageCreationObject = { * Details of the Code Interpreter tool call the run step was involved in. */ export type RunStepDeltaStepDetailsToolCallsCodeObject = { - /** - * The index of the tool call in the tool calls array. - */ - index: number; - /** - * The ID of the tool call. - */ - id?: string; - /** - * The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - */ - type: 'code_interpreter'; - /** - * The Code Interpreter tool call definition. - */ - code_interpreter?: { - /** - * The input to the Code Interpreter tool call. - */ - input?: string; - /** - * The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - */ - outputs?: Array<({ - type?: 'RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject'; - } & RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject) | ({ - type?: 'RunStepDeltaStepDetailsToolCallsCodeOutputImageObject'; - } & RunStepDeltaStepDetailsToolCallsCodeOutputImageObject)>; - }; + /** + * The index of the tool call in the tool calls array. + */ + index: number; + /** + * The ID of the tool call. + */ + id?: string; + /** + * The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + */ + type: 'code_interpreter'; + /** + * The Code Interpreter tool call definition. + */ + code_interpreter?: { + /** + * The input to the Code Interpreter tool call. + */ + input?: string; + /** + * The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. + */ + outputs?: Array< + | ({ + type?: 'RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject'; + } & RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject) + | ({ + type?: 'RunStepDeltaStepDetailsToolCallsCodeOutputImageObject'; + } & RunStepDeltaStepDetailsToolCallsCodeOutputImageObject) + >; + }; }; /** * Code interpreter image output */ export type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject = { - /** - * The index of the output in the outputs array. - */ - index: number; - /** - * Always `image`. + /** + * The index of the output in the outputs array. + */ + index: number; + /** + * Always `image`. + */ + type: 'image'; + image?: { + /** + * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. */ - type: 'image'; - image?: { - /** - * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - */ - file_id?: string; - }; + file_id?: string; + }; }; /** @@ -14431,77 +14898,77 @@ export type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject = { * Text output from the Code Interpreter tool call as part of a run step. */ export type RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject = { - /** - * The index of the output in the outputs array. - */ - index: number; - /** - * Always `logs`. - */ - type: 'logs'; - /** - * The text output from the Code Interpreter tool call. - */ - logs?: string; + /** + * The index of the output in the outputs array. + */ + index: number; + /** + * Always `logs`. + */ + type: 'logs'; + /** + * The text output from the Code Interpreter tool call. + */ + logs?: string; }; /** * File search tool call */ export type RunStepDeltaStepDetailsToolCallsFileSearchObject = { - /** - * The index of the tool call in the tool calls array. - */ - index: number; - /** - * The ID of the tool call object. - */ - id?: string; - /** - * The type of tool call. This is always going to be `file_search` for this type of tool call. - */ - type: 'file_search'; - /** - * For now, this is always going to be an empty object. - */ - file_search: { - [key: string]: unknown; - }; + /** + * The index of the tool call in the tool calls array. + */ + index: number; + /** + * The ID of the tool call object. + */ + id?: string; + /** + * The type of tool call. This is always going to be `file_search` for this type of tool call. + */ + type: 'file_search'; + /** + * For now, this is always going to be an empty object. + */ + file_search: { + [key: string]: unknown; + }; }; /** * Function tool call */ export type RunStepDeltaStepDetailsToolCallsFunctionObject = { - /** - * The index of the tool call in the tool calls array. + /** + * The index of the tool call in the tool calls array. + */ + index: number; + /** + * The ID of the tool call object. + */ + id?: string; + /** + * The type of tool call. This is always going to be `function` for this type of tool call. + */ + type: 'function'; + /** + * The definition of the function that was called. + */ + function?: { + /** + * The name of the function. */ - index: number; - /** - * The ID of the tool call object. - */ - id?: string; + name?: string; /** - * The type of tool call. This is always going to be `function` for this type of tool call. + * The arguments passed to the function. */ - type: 'function'; + arguments?: string; /** - * The definition of the function that was called. + * The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. */ - function?: { - /** - * The name of the function. - */ - name?: string; - /** - * The arguments passed to the function. - */ - arguments?: string; - /** - * The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - */ - output?: string; - }; + output?: string; + }; }; /** @@ -14510,15 +14977,15 @@ export type RunStepDeltaStepDetailsToolCallsFunctionObject = { * Details of the tool call. */ export type RunStepDeltaStepDetailsToolCallsObject = { - /** - * Always `tool_calls`. - */ - type: 'tool_calls'; - /** - * An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - * - */ - tool_calls?: Array; + /** + * Always `tool_calls`. + */ + type: 'tool_calls'; + /** + * An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + * + */ + tool_calls?: Array; }; /** @@ -14527,16 +14994,16 @@ export type RunStepDeltaStepDetailsToolCallsObject = { * Details of the message creation by the run step. */ export type RunStepDetailsMessageCreationObject = { + /** + * Always `message_creation`. + */ + type: 'message_creation'; + message_creation: { /** - * Always `message_creation`. + * The ID of the message that was created by this run step. */ - type: 'message_creation'; - message_creation: { - /** - * The ID of the message that was created by this run step. - */ - message_id: string; - }; + message_id: string; + }; }; /** @@ -14545,47 +15012,50 @@ export type RunStepDetailsMessageCreationObject = { * Details of the Code Interpreter tool call the run step was involved in. */ export type RunStepDetailsToolCallsCodeObject = { - /** - * The ID of the tool call. - */ - id: string; - /** - * The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + /** + * The ID of the tool call. + */ + id: string; + /** + * The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + */ + type: 'code_interpreter'; + /** + * The Code Interpreter tool call definition. + */ + code_interpreter: { + /** + * The input to the Code Interpreter tool call. */ - type: 'code_interpreter'; + input: string; /** - * The Code Interpreter tool call definition. + * The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. */ - code_interpreter: { - /** - * The input to the Code Interpreter tool call. - */ - input: string; - /** - * The outputs from the Code Interpreter tool call. Code Interpreter can output one or more items, including text (`logs`) or images (`image`). Each of these are represented by a different object type. - */ - outputs: Array<({ - type?: 'RunStepDetailsToolCallsCodeOutputLogsObject'; - } & RunStepDetailsToolCallsCodeOutputLogsObject) | ({ - type?: 'RunStepDetailsToolCallsCodeOutputImageObject'; - } & RunStepDetailsToolCallsCodeOutputImageObject)>; - }; + outputs: Array< + | ({ + type?: 'RunStepDetailsToolCallsCodeOutputLogsObject'; + } & RunStepDetailsToolCallsCodeOutputLogsObject) + | ({ + type?: 'RunStepDetailsToolCallsCodeOutputImageObject'; + } & RunStepDetailsToolCallsCodeOutputImageObject) + >; + }; }; /** * Code Interpreter image output */ export type RunStepDetailsToolCallsCodeOutputImageObject = { + /** + * Always `image`. + */ + type: 'image'; + image: { /** - * Always `image`. + * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. */ - type: 'image'; - image: { - /** - * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - */ - file_id: string; - }; + file_id: string; + }; }; /** @@ -14594,38 +15064,38 @@ export type RunStepDetailsToolCallsCodeOutputImageObject = { * Text output from the Code Interpreter tool call as part of a run step. */ export type RunStepDetailsToolCallsCodeOutputLogsObject = { - /** - * Always `logs`. - */ - type: 'logs'; - /** - * The text output from the Code Interpreter tool call. - */ - logs: string; + /** + * Always `logs`. + */ + type: 'logs'; + /** + * The text output from the Code Interpreter tool call. + */ + logs: string; }; /** * File search tool call */ export type RunStepDetailsToolCallsFileSearchObject = { + /** + * The ID of the tool call object. + */ + id: string; + /** + * The type of tool call. This is always going to be `file_search` for this type of tool call. + */ + type: 'file_search'; + /** + * For now, this is always going to be an empty object. + */ + file_search: { + ranking_options?: RunStepDetailsToolCallsFileSearchRankingOptionsObject; /** - * The ID of the tool call object. + * The results of the file search. */ - id: string; - /** - * The type of tool call. This is always going to be `file_search` for this type of tool call. - */ - type: 'file_search'; - /** - * For now, this is always going to be an empty object. - */ - file_search: { - ranking_options?: RunStepDetailsToolCallsFileSearchRankingOptionsObject; - /** - * The results of the file search. - */ - results?: Array; - }; + results?: Array; + }; }; /** @@ -14634,11 +15104,11 @@ export type RunStepDetailsToolCallsFileSearchObject = { * The ranking options for the file search. */ export type RunStepDetailsToolCallsFileSearchRankingOptionsObject = { - ranker: FileSearchRanker; - /** - * The score threshold for the file search. All values must be a floating point number between 0 and 1. - */ - score_threshold: number; + ranker: FileSearchRanker; + /** + * The score threshold for the file search. All values must be a floating point number between 0 and 1. + */ + score_threshold: number; }; /** @@ -14647,241 +15117,260 @@ export type RunStepDetailsToolCallsFileSearchRankingOptionsObject = { * A result instance of the file search. */ export type RunStepDetailsToolCallsFileSearchResultObject = { - /** - * The ID of the file that result was found in. - */ - file_id: string; - /** - * The name of the file that result was found in. - */ - file_name: string; - /** - * The score of the result. All values must be a floating point number between 0 and 1. + /** + * The ID of the file that result was found in. + */ + file_id: string; + /** + * The name of the file that result was found in. + */ + file_name: string; + /** + * The score of the result. All values must be a floating point number between 0 and 1. + */ + score: number; + /** + * The content of the result that was found. The content is only included if requested via the include query parameter. + */ + content?: Array<{ + /** + * The type of the content. + */ + type?: 'text'; + /** + * The text content of the file. */ - score: number; - /** - * The content of the result that was found. The content is only included if requested via the include query parameter. - */ - content?: Array<{ - /** - * The type of the content. - */ - type?: 'text'; - /** - * The text content of the file. - */ - text?: string; - }>; + text?: string; + }>; }; /** * Function tool call */ export type RunStepDetailsToolCallsFunctionObject = { - /** - * The ID of the tool call object. - */ - id: string; - /** - * The type of tool call. This is always going to be `function` for this type of tool call. - */ - type: 'function'; - /** - * The definition of the function that was called. - */ - function: { - /** - * The name of the function. - */ - name: string; - /** - * The arguments passed to the function. - */ - arguments: string; - /** - * The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. - */ - output: string; - }; -}; - -/** - * Tool calls - * - * Details of the tool call. - */ -export type RunStepDetailsToolCallsObject = { - /** - * Always `tool_calls`. - */ - type: 'tool_calls'; - /** - * An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. - * - */ - tool_calls: Array; -}; - -/** - * Run steps - * - * Represents a step in execution of a run. - * - */ -export type RunStepObject = { - /** - * The identifier of the run step, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `thread.run.step`. + /** + * The ID of the tool call object. + */ + id: string; + /** + * The type of tool call. This is always going to be `function` for this type of tool call. + */ + type: 'function'; + /** + * The definition of the function that was called. + */ + function: { + /** + * The name of the function. */ - object: 'thread.run.step'; - /** - * The Unix timestamp (in seconds) for when the run step was created. - */ - created_at: number; - /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - */ - assistant_id: string; - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - */ - thread_id: string; - /** - * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. - */ - run_id: string; - /** - * The type of run step, which can be either `message_creation` or `tool_calls`. - */ - type: 'message_creation' | 'tool_calls'; + name: string; /** - * The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + * The arguments passed to the function. */ - status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired'; + arguments: string; /** - * The details of the run step. + * The output of the function. This will be `null` if the outputs have not been [submitted](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) yet. */ - step_details: ({ + output: string; + }; +}; + +/** + * Tool calls + * + * Details of the tool call. + */ +export type RunStepDetailsToolCallsObject = { + /** + * Always `tool_calls`. + */ + type: 'tool_calls'; + /** + * An array of tool calls the run step was involved in. These can be associated with one of three types of tools: `code_interpreter`, `file_search`, or `function`. + * + */ + tool_calls: Array; +}; + +/** + * Run steps + * + * Represents a step in execution of a run. + * + */ +export type RunStepObject = { + /** + * The identifier of the run step, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `thread.run.step`. + */ + object: 'thread.run.step'; + /** + * The Unix timestamp (in seconds) for when the run step was created. + */ + created_at: number; + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + */ + assistant_id: string; + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + */ + thread_id: string; + /** + * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. + */ + run_id: string; + /** + * The type of run step, which can be either `message_creation` or `tool_calls`. + */ + type: 'message_creation' | 'tool_calls'; + /** + * The status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + */ + status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired'; + /** + * The details of the run step. + */ + step_details: + | ({ type?: 'RunStepDetailsMessageCreationObject'; - } & RunStepDetailsMessageCreationObject) | ({ + } & RunStepDetailsMessageCreationObject) + | ({ type?: 'RunStepDetailsToolCallsObject'; - } & RunStepDetailsToolCallsObject); - /** - * The last error associated with this run step. Will be `null` if there are no errors. - */ - last_error: { - /** - * One of `server_error` or `rate_limit_exceeded`. - */ - code: 'server_error' | 'rate_limit_exceeded'; - /** - * A human-readable description of the error. - */ - message: string; - }; - /** - * The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. - */ - expired_at: number; + } & RunStepDetailsToolCallsObject); + /** + * The last error associated with this run step. Will be `null` if there are no errors. + */ + last_error: { /** - * The Unix timestamp (in seconds) for when the run step was cancelled. + * One of `server_error` or `rate_limit_exceeded`. */ - cancelled_at: number; + code: 'server_error' | 'rate_limit_exceeded'; /** - * The Unix timestamp (in seconds) for when the run step failed. - */ - failed_at: number; - /** - * The Unix timestamp (in seconds) for when the run step completed. + * A human-readable description of the error. */ - completed_at: number; - metadata: Metadata; - usage: RunStepCompletionUsage; -}; - -export type RunStepStreamEvent = { - event: 'thread.run.step.created'; - data: RunStepObject; -} | { - event: 'thread.run.step.in_progress'; - data: RunStepObject; -} | { - event: 'thread.run.step.delta'; - data: RunStepDeltaObject; -} | { - event: 'thread.run.step.completed'; - data: RunStepObject; -} | { - event: 'thread.run.step.failed'; - data: RunStepObject; -} | { - event: 'thread.run.step.cancelled'; - data: RunStepObject; -} | { - event: 'thread.run.step.expired'; - data: RunStepObject; -}; - -export type RunStreamEvent = { - event: 'thread.run.created'; - data: RunObject; -} | { - event: 'thread.run.queued'; - data: RunObject; -} | { - event: 'thread.run.in_progress'; - data: RunObject; -} | { - event: 'thread.run.requires_action'; - data: RunObject; -} | { - event: 'thread.run.completed'; - data: RunObject; -} | { - event: 'thread.run.incomplete'; - data: RunObject; -} | { - event: 'thread.run.failed'; - data: RunObject; -} | { - event: 'thread.run.cancelling'; - data: RunObject; -} | { - event: 'thread.run.cancelled'; - data: RunObject; -} | { - event: 'thread.run.expired'; - data: RunObject; -}; + message: string; + }; + /** + * The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + */ + expired_at: number; + /** + * The Unix timestamp (in seconds) for when the run step was cancelled. + */ + cancelled_at: number; + /** + * The Unix timestamp (in seconds) for when the run step failed. + */ + failed_at: number; + /** + * The Unix timestamp (in seconds) for when the run step completed. + */ + completed_at: number; + metadata: Metadata; + usage: RunStepCompletionUsage; +}; + +export type RunStepStreamEvent = + | { + event: 'thread.run.step.created'; + data: RunStepObject; + } + | { + event: 'thread.run.step.in_progress'; + data: RunStepObject; + } + | { + event: 'thread.run.step.delta'; + data: RunStepDeltaObject; + } + | { + event: 'thread.run.step.completed'; + data: RunStepObject; + } + | { + event: 'thread.run.step.failed'; + data: RunStepObject; + } + | { + event: 'thread.run.step.cancelled'; + data: RunStepObject; + } + | { + event: 'thread.run.step.expired'; + data: RunStepObject; + }; + +export type RunStreamEvent = + | { + event: 'thread.run.created'; + data: RunObject; + } + | { + event: 'thread.run.queued'; + data: RunObject; + } + | { + event: 'thread.run.in_progress'; + data: RunObject; + } + | { + event: 'thread.run.requires_action'; + data: RunObject; + } + | { + event: 'thread.run.completed'; + data: RunObject; + } + | { + event: 'thread.run.incomplete'; + data: RunObject; + } + | { + event: 'thread.run.failed'; + data: RunObject; + } + | { + event: 'thread.run.cancelling'; + data: RunObject; + } + | { + event: 'thread.run.cancelled'; + data: RunObject; + } + | { + event: 'thread.run.expired'; + data: RunObject; + }; /** * Tool call objects */ export type RunToolCallObject = { - /** - * The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + /** + * The ID of the tool call. This ID must be referenced when you submit the tool outputs in using the [Submit tool outputs to run](https://platform.openai.com/docs/api-reference/runs/submitToolOutputs) endpoint. + */ + id: string; + /** + * The type of tool call the output is required for. For now, this is always `function`. + */ + type: 'function'; + /** + * The function definition. + */ + function: { + /** + * The name of the function. */ - id: string; - /** - * The type of tool call the output is required for. For now, this is always `function`. - */ - type: 'function'; + name: string; /** - * The function definition. + * The arguments that the model expects you to pass to the function. */ - function: { - /** - * The name of the function. - */ - name: string; - /** - * The arguments that the model expects you to pass to the function. - */ - arguments: string; - }; + arguments: string; + }; }; /** @@ -14891,12 +15380,12 @@ export type RunToolCallObject = { * */ export type Screenshot = { - /** - * Specifies the event type. For a screenshot action, this property is - * always set to `screenshot`. - * - */ - type: 'screenshot'; + /** + * Specifies the event type. For a screenshot action, this property is + * always set to `screenshot`. + * + */ + type: 'screenshot'; }; /** @@ -14906,32 +15395,32 @@ export type Screenshot = { * */ export type Scroll = { - /** - * Specifies the event type. For a scroll action, this property is - * always set to `scroll`. - * - */ - type: 'scroll'; - /** - * The x-coordinate where the scroll occurred. - * - */ - x: number; - /** - * The y-coordinate where the scroll occurred. - * - */ - y: number; - /** - * The horizontal scroll distance. - * - */ - scroll_x: number; - /** - * The vertical scroll distance. - * - */ - scroll_y: number; + /** + * Specifies the event type. For a scroll action, this property is + * always set to `scroll`. + * + */ + type: 'scroll'; + /** + * The x-coordinate where the scroll occurred. + * + */ + x: number; + /** + * The y-coordinate where the scroll occurred. + * + */ + y: number; + /** + * The horizontal scroll distance. + * + */ + scroll_x: number; + /** + * The vertical scroll distance. + * + */ + scroll_y: number; }; /** @@ -14945,11 +15434,11 @@ export type Scroll = { * */ export const ServiceTier = { - AUTO: 'auto', - DEFAULT: 'default', - FLEX: 'flex', - SCALE: 'scale', - PRIORITY: 'priority' + AUTO: 'auto', + DEFAULT: 'default', + FLEX: 'flex', + SCALE: 'scale', + PRIORITY: 'priority', } as const; /** @@ -14962,65 +15451,65 @@ export const ServiceTier = { * When the `service_tier` parameter is set, the response body will include the `service_tier` value based on the processing mode actually used to serve the request. This response value may be different from the value set in the parameter. * */ -export type ServiceTier = typeof ServiceTier[keyof typeof ServiceTier]; +export type ServiceTier = (typeof ServiceTier)[keyof typeof ServiceTier]; /** * Emitted for each chunk of audio data generated during speech synthesis. */ export type SpeechAudioDeltaEvent = { - /** - * The type of the event. Always `speech.audio.delta`. - * - */ - type: 'speech.audio.delta'; - /** - * A chunk of Base64-encoded audio data. - * - */ - audio: string; + /** + * The type of the event. Always `speech.audio.delta`. + * + */ + type: 'speech.audio.delta'; + /** + * A chunk of Base64-encoded audio data. + * + */ + audio: string; }; /** * Emitted when the speech synthesis is complete and all audio has been streamed. */ export type SpeechAudioDoneEvent = { + /** + * The type of the event. Always `speech.audio.done`. + * + */ + type: 'speech.audio.done'; + /** + * Token usage statistics for the request. + * + */ + usage: { + /** + * Number of input tokens in the prompt. + */ + input_tokens: number; /** - * The type of the event. Always `speech.audio.done`. - * + * Number of output tokens generated. */ - type: 'speech.audio.done'; + output_tokens: number; /** - * Token usage statistics for the request. - * + * Total number of tokens used (input + output). */ - usage: { - /** - * Number of input tokens in the prompt. - */ - input_tokens: number; - /** - * Number of output tokens generated. - */ - output_tokens: number; - /** - * Total number of tokens used (input + output). - */ - total_tokens: number; - }; + total_tokens: number; + }; }; export type StaticChunkingStrategy = { - /** - * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. - */ - max_chunk_size_tokens: number; - /** - * The number of tokens that overlap between chunks. The default value is `400`. - * - * Note that the overlap must not exceed half of `max_chunk_size_tokens`. - * - */ - chunk_overlap_tokens: number; + /** + * The maximum number of tokens in each chunk. The default value is `800`. The minimum value is `100` and the maximum value is `4096`. + */ + max_chunk_size_tokens: number; + /** + * The number of tokens that overlap between chunks. The default value is `400`. + * + * Note that the overlap must not exceed half of `max_chunk_size_tokens`. + * + */ + chunk_overlap_tokens: number; }; /** @@ -15029,22 +15518,22 @@ export type StaticChunkingStrategy = { * Customize your own chunking strategy by setting chunk size and chunk overlap. */ export type StaticChunkingStrategyRequestParam = { - /** - * Always `static`. - */ - type: 'static'; - static: StaticChunkingStrategy; + /** + * Always `static`. + */ + type: 'static'; + static: StaticChunkingStrategy; }; /** * Static Chunking Strategy */ export type StaticChunkingStrategyResponseParam = { - /** - * Always `static`. - */ - type: 'static'; - static: StaticChunkingStrategy; + /** + * Always `static`. + */ + type: 'static'; + static: StaticChunkingStrategy; }; /** @@ -15057,24 +15546,24 @@ export type StaticChunkingStrategyResponseParam = { export type StopConfiguration = string | Array; export type SubmitToolOutputsRunRequest = { + /** + * A list of tools for which the outputs are being submitted. + */ + tool_outputs: Array<{ /** - * A list of tools for which the outputs are being submitted. + * The ID of the tool call in the `required_action` object within the run object the output is being submitted for. */ - tool_outputs: Array<{ - /** - * The ID of the tool call in the `required_action` object within the run object the output is being submitted for. - */ - tool_call_id?: string; - /** - * The output of the tool call to be submitted to continue the run. - */ - output?: string; - }>; + tool_call_id?: string; /** - * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. - * + * The output of the tool call to be submitted to continue the run. */ - stream?: boolean; + output?: string; + }>; + /** + * If `true`, returns a stream of events that happen during the Run as server-sent events, terminating when the Run enters a terminal state with a `data: [DONE]` message. + * + */ + stream?: boolean; }; /** @@ -15093,13 +15582,16 @@ export type SubmitToolOutputsRunRequest = { * is preferred for models that support it. * */ -export type TextResponseFormatConfiguration = ({ - type?: 'ResponseFormatText'; -} & ResponseFormatText) | ({ - type?: 'TextResponseFormatJsonSchema'; -} & TextResponseFormatJsonSchema) | ({ - type?: 'ResponseFormatJsonObject'; -} & ResponseFormatJsonObject); +export type TextResponseFormatConfiguration = + | ({ + type?: 'ResponseFormatText'; + } & ResponseFormatText) + | ({ + type?: 'TextResponseFormatJsonSchema'; + } & TextResponseFormatJsonSchema) + | ({ + type?: 'ResponseFormatJsonObject'; + } & ResponseFormatJsonObject); /** * JSON schema @@ -15109,32 +15601,32 @@ export type TextResponseFormatConfiguration = ({ * */ export type TextResponseFormatJsonSchema = { - /** - * The type of response format being defined. Always `json_schema`. - */ - type: 'json_schema'; - /** - * A description of what the response format is for, used by the model to - * determine how to respond in the format. - * - */ - description?: string; - /** - * The name of the response format. Must be a-z, A-Z, 0-9, or contain - * underscores and dashes, with a maximum length of 64. - * - */ - name: string; - schema: ResponseFormatJsonSchemaSchema; - /** - * Whether to enable strict schema adherence when generating the output. - * If set to true, the model will always follow the exact schema defined - * in the `schema` field. Only a subset of JSON Schema is supported when - * `strict` is `true`. To learn more, read the [Structured Outputs - * guide](https://platform.openai.com/docs/guides/structured-outputs). - * - */ - strict?: boolean; + /** + * The type of response format being defined. Always `json_schema`. + */ + type: 'json_schema'; + /** + * A description of what the response format is for, used by the model to + * determine how to respond in the format. + * + */ + description?: string; + /** + * The name of the response format. Must be a-z, A-Z, 0-9, or contain + * underscores and dashes, with a maximum length of 64. + * + */ + name: string; + schema: ResponseFormatJsonSchemaSchema; + /** + * Whether to enable strict schema adherence when generating the output. + * If set to true, the model will always follow the exact schema defined + * in the `schema` field. Only a subset of JSON Schema is supported when + * `strict` is `true`. To learn more, read the [Structured Outputs + * guide](https://platform.openai.com/docs/guides/structured-outputs). + * + */ + strict?: boolean; }; /** @@ -15143,80 +15635,89 @@ export type TextResponseFormatJsonSchema = { * Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). */ export type ThreadObject = { - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `thread`. - */ - object: 'thread'; - /** - * The Unix timestamp (in seconds) for when the thread was created. - */ - created_at: number; - /** - * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: { - /** - * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. - * - */ - vector_store_ids?: Array; - }; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `thread`. + */ + object: 'thread'; + /** + * The Unix timestamp (in seconds) for when the thread was created. + */ + created_at: number; + /** + * A set of resources that are made available to the assistant's tools in this thread. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; }; - metadata: Metadata; + file_search?: { + /** + * The [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this thread. There can be a maximum of 1 vector store attached to the thread. + * + */ + vector_store_ids?: Array; + }; + }; + metadata: Metadata; }; /** * Occurs when a new [thread](https://platform.openai.com/docs/api-reference/threads/object) is created. */ export type ThreadStreamEvent = { - /** - * Whether to enable input audio transcription. - */ - enabled?: boolean; - event: 'thread.created'; - data: ThreadObject; + /** + * Whether to enable input audio transcription. + */ + enabled?: boolean; + event: 'thread.created'; + data: ThreadObject; }; export type ToggleCertificatesRequest = { - certificate_ids: Array; + certificate_ids: Array; }; /** * A tool that can be used to generate a response. * */ -export type Tool = ({ - type?: 'FunctionTool'; -} & FunctionTool) | ({ - type?: 'FileSearchTool'; -} & FileSearchTool) | ({ - type?: 'WebSearchPreviewTool'; -} & WebSearchPreviewTool) | ({ - type?: 'ComputerUsePreviewTool'; -} & ComputerUsePreviewTool) | ({ - type?: 'MCPTool'; -} & McpTool) | ({ - type?: 'CodeInterpreterTool'; -} & CodeInterpreterTool) | ({ - type?: 'ImageGenTool'; -} & ImageGenTool) | ({ - type?: 'LocalShellTool'; -} & LocalShellTool) | ({ - type?: 'CustomTool'; -} & CustomTool); +export type Tool = + | ({ + type?: 'FunctionTool'; + } & FunctionTool) + | ({ + type?: 'FileSearchTool'; + } & FileSearchTool) + | ({ + type?: 'WebSearchPreviewTool'; + } & WebSearchPreviewTool) + | ({ + type?: 'ComputerUsePreviewTool'; + } & ComputerUsePreviewTool) + | ({ + type?: 'MCPTool'; + } & McpTool) + | ({ + type?: 'CodeInterpreterTool'; + } & CodeInterpreterTool) + | ({ + type?: 'ImageGenTool'; + } & ImageGenTool) + | ({ + type?: 'LocalShellTool'; + } & LocalShellTool) + | ({ + type?: 'CustomTool'; + } & CustomTool); /** * Allowed tools @@ -15225,36 +15726,36 @@ export type Tool = ({ * */ export type ToolChoiceAllowed = { - /** - * Allowed tool configuration type. Always `allowed_tools`. - */ - type: 'allowed_tools'; - /** - * Constrains the tools available to the model to a pre-defined set. - * - * `auto` allows the model to pick from among the allowed tools and generate a - * message. - * - * `required` requires the model to call one or more of the allowed tools. - * - */ - mode: 'auto' | 'required'; - /** - * A list of tool definitions that the model should be allowed to call. - * - * For the Responses API, the list of tool definitions might look like: - * ```json - * [ - * { "type": "function", "name": "get_weather" }, - * { "type": "mcp", "server_label": "deepwiki" }, - * { "type": "image_generation" } - * ] - * ``` - * - */ - tools: Array<{ - [key: string]: unknown; - }>; + /** + * Allowed tool configuration type. Always `allowed_tools`. + */ + type: 'allowed_tools'; + /** + * Constrains the tools available to the model to a pre-defined set. + * + * `auto` allows the model to pick from among the allowed tools and generate a + * message. + * + * `required` requires the model to call one or more of the allowed tools. + * + */ + mode: 'auto' | 'required'; + /** + * A list of tool definitions that the model should be allowed to call. + * + * For the Responses API, the list of tool definitions might look like: + * ```json + * [ + * { "type": "function", "name": "get_weather" }, + * { "type": "mcp", "server_label": "deepwiki" }, + * { "type": "image_generation" } + * ] + * ``` + * + */ + tools: Array<{ + [key: string]: unknown; + }>; }; /** @@ -15264,14 +15765,14 @@ export type ToolChoiceAllowed = { * */ export type ToolChoiceCustom = { - /** - * For custom tool calling, the type is always `custom`. - */ - type: 'custom'; - /** - * The name of the custom tool to call. - */ - name: string; + /** + * For custom tool calling, the type is always `custom`. + */ + type: 'custom'; + /** + * The name of the custom tool to call. + */ + name: string; }; /** @@ -15281,14 +15782,14 @@ export type ToolChoiceCustom = { * */ export type ToolChoiceFunction = { - /** - * For function calling, the type is always `function`. - */ - type: 'function'; - /** - * The name of the function to call. - */ - name: string; + /** + * For function calling, the type is always `function`. + */ + type: 'function'; + /** + * The name of the function to call. + */ + name: string; }; /** @@ -15298,20 +15799,20 @@ export type ToolChoiceFunction = { * */ export type ToolChoiceMcp = { - /** - * For MCP tools, the type is always `mcp`. - */ - type: 'mcp'; - /** - * The label of the MCP server to use. - * - */ - server_label: string; - /** - * The name of the tool to call on the server. - * - */ - name?: string; + /** + * For MCP tools, the type is always `mcp`. + */ + type: 'mcp'; + /** + * The label of the MCP server to use. + * + */ + server_label: string; + /** + * The name of the tool to call on the server. + * + */ + name?: string; }; /** @@ -15328,9 +15829,9 @@ export type ToolChoiceMcp = { * */ export const ToolChoiceOptions = { - NONE: 'none', - AUTO: 'auto', - REQUIRED: 'required' + NONE: 'none', + AUTO: 'auto', + REQUIRED: 'required', } as const; /** @@ -15346,7 +15847,7 @@ export const ToolChoiceOptions = { * `required` means the model must call one or more tools. * */ -export type ToolChoiceOptions = typeof ToolChoiceOptions[keyof typeof ToolChoiceOptions]; +export type ToolChoiceOptions = (typeof ToolChoiceOptions)[keyof typeof ToolChoiceOptions]; /** * Hosted tool @@ -15356,147 +15857,153 @@ export type ToolChoiceOptions = typeof ToolChoiceOptions[keyof typeof ToolChoice * */ export type ToolChoiceTypes = { - /** - * The type of hosted tool the model should to use. Learn more about - * [built-in tools](https://platform.openai.com/docs/guides/tools). - * - * Allowed values are: - * - `file_search` - * - `web_search_preview` - * - `computer_use_preview` - * - `code_interpreter` - * - `image_generation` - * - */ - type: 'file_search' | 'web_search_preview' | 'computer_use_preview' | 'web_search_preview_2025_03_11' | 'image_generation' | 'code_interpreter'; + /** + * The type of hosted tool the model should to use. Learn more about + * [built-in tools](https://platform.openai.com/docs/guides/tools). + * + * Allowed values are: + * - `file_search` + * - `web_search_preview` + * - `computer_use_preview` + * - `code_interpreter` + * - `image_generation` + * + */ + type: + | 'file_search' + | 'web_search_preview' + | 'computer_use_preview' + | 'web_search_preview_2025_03_11' + | 'image_generation' + | 'code_interpreter'; }; /** * Emitted when there is an additional text delta. This is also the first event emitted when the transcription starts. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. */ export type TranscriptTextDeltaEvent = { + /** + * The type of the event. Always `transcript.text.delta`. + * + */ + type: 'transcript.text.delta'; + /** + * The text delta that was additionally transcribed. + * + */ + delta: string; + /** + * The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. + * + */ + logprobs?: Array<{ /** - * The type of the event. Always `transcript.text.delta`. + * The token that was used to generate the log probability. * */ - type: 'transcript.text.delta'; + token?: string; /** - * The text delta that was additionally transcribed. + * The log probability of the token. * */ - delta: string; + logprob?: number; /** - * The log probabilities of the delta. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. + * The bytes that were used to generate the log probability. * */ - logprobs?: Array<{ - /** - * The token that was used to generate the log probability. - * - */ - token?: string; - /** - * The log probability of the token. - * - */ - logprob?: number; - /** - * The bytes that were used to generate the log probability. - * - */ - bytes?: Array; - }>; + bytes?: Array; + }>; }; /** * Emitted when the transcription is complete. Contains the complete transcription text. Only emitted when you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `Stream` parameter set to `true`. */ export type TranscriptTextDoneEvent = { + /** + * The type of the event. Always `transcript.text.done`. + * + */ + type: 'transcript.text.done'; + /** + * The text that was transcribed. + * + */ + text: string; + /** + * The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. + * + */ + logprobs?: Array<{ /** - * The type of the event. Always `transcript.text.done`. + * The token that was used to generate the log probability. * */ - type: 'transcript.text.done'; + token?: string; /** - * The text that was transcribed. + * The log probability of the token. * */ - text: string; + logprob?: number; /** - * The log probabilities of the individual tokens in the transcription. Only included if you [create a transcription](https://platform.openai.com/docs/api-reference/audio/create-transcription) with the `include[]` parameter set to `logprobs`. + * The bytes that were used to generate the log probability. * */ - logprobs?: Array<{ - /** - * The token that was used to generate the log probability. - * - */ - token?: string; - /** - * The log probability of the token. - * - */ - logprob?: number; - /** - * The bytes that were used to generate the log probability. - * - */ - bytes?: Array; - }>; - usage?: TranscriptTextUsageTokens; -}; - -/** - * Duration Usage - * - * Usage statistics for models billed by audio input duration. - */ -export type TranscriptTextUsageDuration = { - /** - * The type of the usage object. Always `duration` for this variant. - */ - type: 'duration'; - /** - * Duration of the input audio in seconds. - */ - seconds: number; + bytes?: Array; + }>; + usage?: TranscriptTextUsageTokens; }; - -/** - * Token Usage - * - * Usage statistics for models billed by token usage. - */ -export type TranscriptTextUsageTokens = { - /** - * The type of the usage object. Always `tokens` for this variant. - */ - type: 'tokens'; - /** - * Number of input tokens billed for this request. - */ - input_tokens: number; - /** - * Details about the input tokens billed for this request. - */ - input_token_details?: { - /** - * Number of text tokens billed for this request. - */ - text_tokens?: number; - /** - * Number of audio tokens billed for this request. - */ - audio_tokens?: number; - }; - /** - * Number of output tokens generated. - */ - output_tokens: number; - /** - * Total number of tokens used (input + output). - */ - total_tokens: number; + +/** + * Duration Usage + * + * Usage statistics for models billed by audio input duration. + */ +export type TranscriptTextUsageDuration = { + /** + * The type of the usage object. Always `duration` for this variant. + */ + type: 'duration'; + /** + * Duration of the input audio in seconds. + */ + seconds: number; +}; + +/** + * Token Usage + * + * Usage statistics for models billed by token usage. + */ +export type TranscriptTextUsageTokens = { + /** + * The type of the usage object. Always `tokens` for this variant. + */ + type: 'tokens'; + /** + * Number of input tokens billed for this request. + */ + input_tokens: number; + /** + * Details about the input tokens billed for this request. + */ + input_token_details?: { + /** + * Number of text tokens billed for this request. + */ + text_tokens?: number; + /** + * Number of audio tokens billed for this request. + */ + audio_tokens?: number; + }; + /** + * Number of output tokens generated. + */ + output_tokens: number; + /** + * Total number of tokens used (input + output). + */ + total_tokens: number; }; /** @@ -15506,64 +16013,64 @@ export type TranscriptionChunkingStrategy = 'auto' | VadConfig; export const TranscriptionInclude = { LOGPROBS: 'logprobs' } as const; -export type TranscriptionInclude = typeof TranscriptionInclude[keyof typeof TranscriptionInclude]; +export type TranscriptionInclude = (typeof TranscriptionInclude)[keyof typeof TranscriptionInclude]; export type TranscriptionSegment = { - /** - * Unique identifier of the segment. - */ - id: number; - /** - * Seek offset of the segment. - */ - seek: number; - /** - * Start time of the segment in seconds. - */ - start: number; - /** - * End time of the segment in seconds. - */ - end: number; - /** - * Text content of the segment. - */ - text: string; - /** - * Array of token IDs for the text content. - */ - tokens: Array; - /** - * Temperature parameter used for generating the segment. - */ - temperature: number; - /** - * Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. - */ - avg_logprob: number; - /** - * Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. - */ - compression_ratio: number; - /** - * Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent. - */ - no_speech_prob: number; + /** + * Unique identifier of the segment. + */ + id: number; + /** + * Seek offset of the segment. + */ + seek: number; + /** + * Start time of the segment in seconds. + */ + start: number; + /** + * End time of the segment in seconds. + */ + end: number; + /** + * Text content of the segment. + */ + text: string; + /** + * Array of token IDs for the text content. + */ + tokens: Array; + /** + * Temperature parameter used for generating the segment. + */ + temperature: number; + /** + * Average logprob of the segment. If the value is lower than -1, consider the logprobs failed. + */ + avg_logprob: number; + /** + * Compression ratio of the segment. If the value is greater than 2.4, consider the compression failed. + */ + compression_ratio: number; + /** + * Probability of no speech in the segment. If the value is higher than 1.0 and the `avg_logprob` is below -1, consider this segment silent. + */ + no_speech_prob: number; }; export type TranscriptionWord = { - /** - * The text content of the word. - */ - word: string; - /** - * Start time of the word in seconds. - */ - start: number; - /** - * End time of the word in seconds. - */ - end: number; + /** + * The text content of the word. + */ + word: string; + /** + * Start time of the word in seconds. + */ + start: number; + /** + * End time of the word in seconds. + */ + end: number; }; /** @@ -15572,14 +16079,14 @@ export type TranscriptionWord = { * Controls for how a thread will be truncated prior to the run. Use this to control the initial context window of the run. */ export type TruncationObject = { - /** - * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. - */ - type: 'auto' | 'last_messages'; - /** - * The number of most recent messages from the thread when constructing the context for the run. - */ - last_messages?: number; + /** + * The truncation strategy to use for the thread. The default is `auto`. If set to `last_messages`, the thread will be truncated to the n most recent messages in the thread. When set to `auto`, messages in the middle of the thread will be dropped to fit the context length of the model, `max_prompt_tokens`. + */ + type: 'auto' | 'last_messages'; + /** + * The number of most recent messages from the thread when constructing the context for the run. + */ + last_messages?: number; }; /** @@ -15589,30 +16096,30 @@ export type TruncationObject = { * */ export type Type = { - /** - * Specifies the event type. For a type action, this property is - * always set to `type`. - * - */ - type: 'type'; - /** - * The text to type. - * - */ - text: string; + /** + * Specifies the event type. For a type action, this property is + * always set to `type`. + * + */ + type: 'type'; + /** + * The text to type. + * + */ + text: string; }; export type UpdateVectorStoreFileAttributesRequest = { - attributes: VectorStoreFileAttributes; + attributes: VectorStoreFileAttributes; }; export type UpdateVectorStoreRequest = { - /** - * The name of the vector store. - */ - name?: string; - expires_after?: VectorStoreExpirationAfter & unknown; - metadata?: Metadata; + /** + * The name of the vector store. + */ + name?: string; + expires_after?: VectorStoreExpirationAfter & unknown; + metadata?: Metadata; }; /** @@ -15622,50 +16129,50 @@ export type UpdateVectorStoreRequest = { * */ export type Upload = { - /** - * The Upload unique identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when the Upload was created. - */ - created_at: number; - /** - * The name of the file to be uploaded. - */ - filename: string; - /** - * The intended number of bytes to be uploaded. - */ - bytes: number; - /** - * The intended purpose of the file. [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) for acceptable values. - */ - purpose: string; - /** - * The status of the Upload. - */ - status: 'pending' | 'completed' | 'cancelled' | 'expired'; - /** - * The Unix timestamp (in seconds) for when the Upload will expire. - */ - expires_at: number; - /** - * The object type, which is always "upload". - */ - object: 'upload'; - file?: OpenAiFile & unknown; + /** + * The Upload unique identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the Upload was created. + */ + created_at: number; + /** + * The name of the file to be uploaded. + */ + filename: string; + /** + * The intended number of bytes to be uploaded. + */ + bytes: number; + /** + * The intended purpose of the file. [Please refer here](https://platform.openai.com/docs/api-reference/files/object#files/object-purpose) for acceptable values. + */ + purpose: string; + /** + * The status of the Upload. + */ + status: 'pending' | 'completed' | 'cancelled' | 'expired'; + /** + * The Unix timestamp (in seconds) for when the Upload will expire. + */ + expires_at: number; + /** + * The object type, which is always "upload". + */ + object: 'upload'; + file?: OpenAiFile & unknown; }; export type UploadCertificateRequest = { - /** - * An optional name for the certificate - */ - name?: string; - /** - * The certificate content in PEM format - */ - content: string; + /** + * An optional name for the certificate + */ + name?: string; + /** + * The certificate content in PEM format + */ + content: string; }; /** @@ -15675,412 +16182,422 @@ export type UploadCertificateRequest = { * */ export type UploadPart = { - /** - * The upload Part unique identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The Unix timestamp (in seconds) for when the Part was created. - */ - created_at: number; - /** - * The ID of the Upload object that this Part was added to. - */ - upload_id: string; - /** - * The object type, which is always `upload.part`. - */ - object: 'upload.part'; + /** + * The upload Part unique identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the Part was created. + */ + created_at: number; + /** + * The ID of the Upload object that this Part was added to. + */ + upload_id: string; + /** + * The object type, which is always `upload.part`. + */ + object: 'upload.part'; }; /** * The aggregated audio speeches usage details of the specific time bucket. */ export type UsageAudioSpeechesResult = { - object: 'organization.usage.audio_speeches.result'; - /** - * The number of characters processed. - */ - characters: number; - /** - * The count of requests made to the model. - */ - num_model_requests: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; - /** - * When `group_by=user_id`, this field provides the user ID of the grouped usage result. - */ - user_id?: string; - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; + object: 'organization.usage.audio_speeches.result'; + /** + * The number of characters processed. + */ + characters: number; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: string; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; }; /** * The aggregated audio transcriptions usage details of the specific time bucket. */ export type UsageAudioTranscriptionsResult = { - object: 'organization.usage.audio_transcriptions.result'; - /** - * The number of seconds processed. - */ - seconds: number; - /** - * The count of requests made to the model. - */ - num_model_requests: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; - /** - * When `group_by=user_id`, this field provides the user ID of the grouped usage result. - */ - user_id?: string; - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; + object: 'organization.usage.audio_transcriptions.result'; + /** + * The number of seconds processed. + */ + seconds: number; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: string; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; }; /** * The aggregated code interpreter sessions usage details of the specific time bucket. */ export type UsageCodeInterpreterSessionsResult = { - object: 'organization.usage.code_interpreter_sessions.result'; - /** - * The number of code interpreter sessions. - */ - num_sessions?: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; + object: 'organization.usage.code_interpreter_sessions.result'; + /** + * The number of code interpreter sessions. + */ + num_sessions?: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; }; /** * The aggregated completions usage details of the specific time bucket. */ export type UsageCompletionsResult = { - object: 'organization.usage.completions.result'; - /** - * The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. - */ - input_tokens: number; - /** - * The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. - */ - input_cached_tokens?: number; - /** - * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. - */ - output_tokens: number; - /** - * The aggregated number of audio input tokens used, including cached tokens. - */ - input_audio_tokens?: number; - /** - * The aggregated number of audio output tokens used. - */ - output_audio_tokens?: number; - /** - * The count of requests made to the model. - */ - num_model_requests: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; - /** - * When `group_by=user_id`, this field provides the user ID of the grouped usage result. - */ - user_id?: string; - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; - /** - * When `group_by=batch`, this field tells whether the grouped usage result is batch or not. - */ - batch?: boolean; + object: 'organization.usage.completions.result'; + /** + * The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. + */ + input_tokens: number; + /** + * The aggregated number of text input tokens that has been cached from previous requests. For customers subscribe to scale tier, this includes scale tier tokens. + */ + input_cached_tokens?: number; + /** + * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. + */ + output_tokens: number; + /** + * The aggregated number of audio input tokens used, including cached tokens. + */ + input_audio_tokens?: number; + /** + * The aggregated number of audio output tokens used. + */ + output_audio_tokens?: number; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: string; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; + /** + * When `group_by=batch`, this field tells whether the grouped usage result is batch or not. + */ + batch?: boolean; }; /** * The aggregated embeddings usage details of the specific time bucket. */ export type UsageEmbeddingsResult = { - object: 'organization.usage.embeddings.result'; - /** - * The aggregated number of input tokens used. - */ - input_tokens: number; - /** - * The count of requests made to the model. - */ - num_model_requests: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; - /** - * When `group_by=user_id`, this field provides the user ID of the grouped usage result. - */ - user_id?: string; - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; + object: 'organization.usage.embeddings.result'; + /** + * The aggregated number of input tokens used. + */ + input_tokens: number; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: string; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; }; /** * The aggregated images usage details of the specific time bucket. */ export type UsageImagesResult = { - object: 'organization.usage.images.result'; - /** - * The number of images processed. - */ - images: number; - /** - * The count of requests made to the model. - */ - num_model_requests: number; - /** - * When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. - */ - source?: string; - /** - * When `group_by=size`, this field provides the image size of the grouped usage result. - */ - size?: string; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; - /** - * When `group_by=user_id`, this field provides the user ID of the grouped usage result. - */ - user_id?: string; - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; + object: 'organization.usage.images.result'; + /** + * The number of images processed. + */ + images: number; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + /** + * When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. + */ + source?: string; + /** + * When `group_by=size`, this field provides the image size of the grouped usage result. + */ + size?: string; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: string; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; }; /** * The aggregated moderations usage details of the specific time bucket. */ export type UsageModerationsResult = { - object: 'organization.usage.moderations.result'; - /** - * The aggregated number of input tokens used. - */ - input_tokens: number; - /** - * The count of requests made to the model. - */ - num_model_requests: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; - /** - * When `group_by=user_id`, this field provides the user ID of the grouped usage result. - */ - user_id?: string; - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; + object: 'organization.usage.moderations.result'; + /** + * The aggregated number of input tokens used. + */ + input_tokens: number; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: string; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; }; export type UsageResponse = { - object: 'page'; - data: Array; - has_more: boolean; - next_page: string; + object: 'page'; + data: Array; + has_more: boolean; + next_page: string; }; export type UsageTimeBucket = { - object: 'bucket'; - start_time: number; - end_time: number; - result: Array<({ + object: 'bucket'; + start_time: number; + end_time: number; + result: Array< + | ({ object?: 'UsageCompletionsResult'; - } & UsageCompletionsResult) | ({ + } & UsageCompletionsResult) + | ({ object?: 'UsageEmbeddingsResult'; - } & UsageEmbeddingsResult) | ({ + } & UsageEmbeddingsResult) + | ({ object?: 'UsageModerationsResult'; - } & UsageModerationsResult) | ({ + } & UsageModerationsResult) + | ({ object?: 'UsageImagesResult'; - } & UsageImagesResult) | ({ + } & UsageImagesResult) + | ({ object?: 'UsageAudioSpeechesResult'; - } & UsageAudioSpeechesResult) | ({ + } & UsageAudioSpeechesResult) + | ({ object?: 'UsageAudioTranscriptionsResult'; - } & UsageAudioTranscriptionsResult) | ({ + } & UsageAudioTranscriptionsResult) + | ({ object?: 'UsageVectorStoresResult'; - } & UsageVectorStoresResult) | ({ + } & UsageVectorStoresResult) + | ({ object?: 'UsageCodeInterpreterSessionsResult'; - } & UsageCodeInterpreterSessionsResult) | ({ + } & UsageCodeInterpreterSessionsResult) + | ({ object?: 'CostsResult'; - } & CostsResult)>; + } & CostsResult) + >; }; /** * The aggregated vector stores usage details of the specific time bucket. */ export type UsageVectorStoresResult = { - object: 'organization.usage.vector_stores.result'; - /** - * The vector stores usage in bytes. - */ - usage_bytes: number; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; + object: 'organization.usage.vector_stores.result'; + /** + * The vector stores usage in bytes. + */ + usage_bytes: number; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; }; /** * Represents an individual `user` within an organization. */ export type User = { - /** - * The object type, which is always `organization.user` - */ - object: 'organization.user'; - /** - * The identifier, which can be referenced in API endpoints - */ - id: string; - /** - * The name of the user - */ - name: string; - /** - * The email address of the user - */ - email: string; - /** - * `owner` or `reader` - */ - role: 'owner' | 'reader'; - /** - * The Unix timestamp (in seconds) of when the user was added. - */ - added_at: number; + /** + * The object type, which is always `organization.user` + */ + object: 'organization.user'; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the user + */ + name: string; + /** + * The email address of the user + */ + email: string; + /** + * `owner` or `reader` + */ + role: 'owner' | 'reader'; + /** + * The Unix timestamp (in seconds) of when the user was added. + */ + added_at: number; }; export type UserDeleteResponse = { - object: 'organization.user.deleted'; - id: string; - deleted: boolean; + object: 'organization.user.deleted'; + id: string; + deleted: boolean; }; export type UserListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + object: 'list'; + data: Array; + first_id: string; + last_id: string; + has_more: boolean; }; export type UserRoleUpdateRequest = { - /** - * `owner` or `reader` - */ - role: 'owner' | 'reader'; + /** + * `owner` or `reader` + */ + role: 'owner' | 'reader'; }; export type VadConfig = { - /** - * Must be set to `server_vad` to enable manual chunking using server side VAD. - */ - type: 'server_vad'; - /** - * Amount of audio to include before the VAD detected speech (in - * milliseconds). - * - */ - prefix_padding_ms?: number; - /** - * Duration of silence to detect speech stop (in milliseconds). - * With shorter values the model will respond more quickly, - * but may jump in on short pauses from the user. - * - */ - silence_duration_ms?: number; - /** - * Sensitivity threshold (0.0 to 1.0) for voice activity detection. A - * higher threshold will require louder audio to activate the model, and - * thus might perform better in noisy environments. - * - */ - threshold?: number; + /** + * Must be set to `server_vad` to enable manual chunking using server side VAD. + */ + type: 'server_vad'; + /** + * Amount of audio to include before the VAD detected speech (in + * milliseconds). + * + */ + prefix_padding_ms?: number; + /** + * Duration of silence to detect speech stop (in milliseconds). + * With shorter values the model will respond more quickly, + * but may jump in on short pauses from the user. + * + */ + silence_duration_ms?: number; + /** + * Sensitivity threshold (0.0 to 1.0) for voice activity detection. A + * higher threshold will require louder audio to activate the model, and + * thus might perform better in noisy environments. + * + */ + threshold?: number; }; /** * ValidateGraderRequest */ export type ValidateGraderRequest = { - /** - * The grader used for the fine-tuning job. - */ - grader: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderMulti; + /** + * The grader used for the fine-tuning job. + */ + grader: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderMulti; }; /** * ValidateGraderResponse */ export type ValidateGraderResponse = { - /** - * The grader used for the fine-tuning job. - */ - grader?: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderMulti; + /** + * The grader used for the fine-tuning job. + */ + grader?: GraderStringCheck | GraderTextSimilarity | GraderPython | GraderScoreModel | GraderMulti; }; /** * Vector store expiration policy * * The expiration policy for a vector store. - */ -export type VectorStoreExpirationAfter = { - /** - * Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. - */ - anchor: 'last_active_at'; - /** - * The number of days after the anchor time that the vector store will expire. - */ - days: number; + */ +export type VectorStoreExpirationAfter = { + /** + * Anchor timestamp after which the expiration policy applies. Supported anchors: `last_active_at`. + */ + anchor: 'last_active_at'; + /** + * The number of days after the anchor time that the vector store will expire. + */ + days: number; }; /** @@ -16092,7 +16609,7 @@ export type VectorStoreExpirationAfter = { * */ export type VectorStoreFileAttributes = { - [key: string]: string | number | boolean; + [key: string]: string | number | boolean; }; /** @@ -16101,79 +16618,79 @@ export type VectorStoreFileAttributes = { * A batch of files attached to a vector store. */ export type VectorStoreFileBatchObject = { - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `vector_store.file_batch`. + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `vector_store.file_batch`. + */ + object: 'vector_store.files_batch'; + /** + * The Unix timestamp (in seconds) for when the vector store files batch was created. + */ + created_at: number; + /** + * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. + */ + vector_store_id: string; + /** + * The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. + */ + status: 'in_progress' | 'completed' | 'cancelled' | 'failed'; + file_counts: { + /** + * The number of files that are currently being processed. + */ + in_progress: number; + /** + * The number of files that have been processed. */ - object: 'vector_store.files_batch'; + completed: number; /** - * The Unix timestamp (in seconds) for when the vector store files batch was created. + * The number of files that have failed to process. */ - created_at: number; + failed: number; /** - * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. + * The number of files that where cancelled. */ - vector_store_id: string; + cancelled: number; /** - * The status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. + * The total number of files. */ - status: 'in_progress' | 'completed' | 'cancelled' | 'failed'; - file_counts: { - /** - * The number of files that are currently being processed. - */ - in_progress: number; - /** - * The number of files that have been processed. - */ - completed: number; - /** - * The number of files that have failed to process. - */ - failed: number; - /** - * The number of files that where cancelled. - */ - cancelled: number; - /** - * The total number of files. - */ - total: number; - }; + total: number; + }; }; /** * Represents the parsed content of a vector store file. */ export type VectorStoreFileContentResponse = { + /** + * The object type, which is always `vector_store.file_content.page` + */ + object: 'vector_store.file_content.page'; + /** + * Parsed content of the file. + */ + data: Array<{ /** - * The object type, which is always `vector_store.file_content.page` - */ - object: 'vector_store.file_content.page'; - /** - * Parsed content of the file. + * The content type (currently only `"text"`) */ - data: Array<{ - /** - * The content type (currently only `"text"`) - */ - type?: string; - /** - * The text content - */ - text?: string; - }>; - /** - * Indicates if there are more content pages to fetch. - */ - has_more: boolean; + type?: string; /** - * The token for the next page, if any. + * The text content */ - next_page: string; + text?: string; + }>; + /** + * Indicates if there are more content pages to fetch. + */ + has_more: boolean; + /** + * The token for the next page, if any. + */ + next_page: string; }; /** @@ -16182,45 +16699,45 @@ export type VectorStoreFileContentResponse = { * A list of files attached to a vector store. */ export type VectorStoreFileObject = { + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `vector_store.file`. + */ + object: 'vector_store.file'; + /** + * The total vector store usage in bytes. Note that this may be different from the original file size. + */ + usage_bytes: number; + /** + * The Unix timestamp (in seconds) for when the vector store file was created. + */ + created_at: number; + /** + * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. + */ + vector_store_id: string; + /** + * The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. + */ + status: 'in_progress' | 'completed' | 'cancelled' | 'failed'; + /** + * The last error associated with this vector store file. Will be `null` if there are no errors. + */ + last_error: { + /** + * One of `server_error` or `rate_limit_exceeded`. + */ + code: 'server_error' | 'unsupported_file' | 'invalid_file'; /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `vector_store.file`. - */ - object: 'vector_store.file'; - /** - * The total vector store usage in bytes. Note that this may be different from the original file size. - */ - usage_bytes: number; - /** - * The Unix timestamp (in seconds) for when the vector store file was created. - */ - created_at: number; - /** - * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) that the [File](https://platform.openai.com/docs/api-reference/files) is attached to. - */ - vector_store_id: string; - /** - * The status of the vector store file, which can be either `in_progress`, `completed`, `cancelled`, or `failed`. The status `completed` indicates that the vector store file is ready for use. - */ - status: 'in_progress' | 'completed' | 'cancelled' | 'failed'; - /** - * The last error associated with this vector store file. Will be `null` if there are no errors. + * A human-readable description of the error. */ - last_error: { - /** - * One of `server_error` or `rate_limit_exceeded`. - */ - code: 'server_error' | 'unsupported_file' | 'invalid_file'; - /** - * A human-readable description of the error. - */ - message: string; - }; - chunking_strategy?: ChunkingStrategyResponse; - attributes?: VectorStoreFileAttributes; + message: string; + }; + chunking_strategy?: ChunkingStrategyResponse; + attributes?: VectorStoreFileAttributes; }; /** @@ -16229,142 +16746,142 @@ export type VectorStoreFileObject = { * A vector store is a collection of processed files can be used by the `file_search` tool. */ export type VectorStoreObject = { - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always `vector_store`. - */ - object: 'vector_store'; - /** - * The Unix timestamp (in seconds) for when the vector store was created. - */ - created_at: number; - /** - * The name of the vector store. + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `vector_store`. + */ + object: 'vector_store'; + /** + * The Unix timestamp (in seconds) for when the vector store was created. + */ + created_at: number; + /** + * The name of the vector store. + */ + name: string; + /** + * The total number of bytes used by the files in the vector store. + */ + usage_bytes: number; + file_counts: { + /** + * The number of files that are currently being processed. + */ + in_progress: number; + /** + * The number of files that have been successfully processed. */ - name: string; - /** - * The total number of bytes used by the files in the vector store. - */ - usage_bytes: number; - file_counts: { - /** - * The number of files that are currently being processed. - */ - in_progress: number; - /** - * The number of files that have been successfully processed. - */ - completed: number; - /** - * The number of files that have failed to process. - */ - failed: number; - /** - * The number of files that were cancelled. - */ - cancelled: number; - /** - * The total number of files. - */ - total: number; - }; + completed: number; /** - * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. + * The number of files that have failed to process. */ - status: 'expired' | 'in_progress' | 'completed'; - expires_after?: VectorStoreExpirationAfter; + failed: number; /** - * The Unix timestamp (in seconds) for when the vector store will expire. + * The number of files that were cancelled. */ - expires_at?: number; + cancelled: number; /** - * The Unix timestamp (in seconds) for when the vector store was last active. + * The total number of files. */ - last_active_at: number; - metadata: Metadata; + total: number; + }; + /** + * The status of the vector store, which can be either `expired`, `in_progress`, or `completed`. A status of `completed` indicates that the vector store is ready for use. + */ + status: 'expired' | 'in_progress' | 'completed'; + expires_after?: VectorStoreExpirationAfter; + /** + * The Unix timestamp (in seconds) for when the vector store will expire. + */ + expires_at?: number; + /** + * The Unix timestamp (in seconds) for when the vector store was last active. + */ + last_active_at: number; + metadata: Metadata; }; export type VectorStoreSearchRequest = { - /** - * A query string for a search - */ - query: string | Array; - /** - * Whether to rewrite the natural language query for vector search. - */ - rewrite_query?: boolean; - /** - * The maximum number of results to return. This number should be between 1 and 50 inclusive. - */ - max_num_results?: number; - /** - * A filter to apply based on file attributes. - */ - filters?: ComparisonFilter | CompoundFilter; - /** - * Ranking options for search. - */ - ranking_options?: { - /** - * Enable re-ranking; set to `none` to disable, which can help reduce latency. - */ - ranker?: 'none' | 'auto' | 'default-2024-11-15'; - score_threshold?: number; - }; + /** + * A query string for a search + */ + query: string | Array; + /** + * Whether to rewrite the natural language query for vector search. + */ + rewrite_query?: boolean; + /** + * The maximum number of results to return. This number should be between 1 and 50 inclusive. + */ + max_num_results?: number; + /** + * A filter to apply based on file attributes. + */ + filters?: ComparisonFilter | CompoundFilter; + /** + * Ranking options for search. + */ + ranking_options?: { + /** + * Enable re-ranking; set to `none` to disable, which can help reduce latency. + */ + ranker?: 'none' | 'auto' | 'default-2024-11-15'; + score_threshold?: number; + }; }; export type VectorStoreSearchResultContentObject = { - /** - * The type of content. - */ - type: 'text'; - /** - * The text content returned from search. - */ - text: string; + /** + * The type of content. + */ + type: 'text'; + /** + * The text content returned from search. + */ + text: string; }; export type VectorStoreSearchResultItem = { - /** - * The ID of the vector store file. - */ - file_id: string; - /** - * The name of the vector store file. - */ - filename: string; - /** - * The similarity score for the result. - */ - score: number; - attributes: VectorStoreFileAttributes; - /** - * Content chunks from the file. - */ - content: Array; + /** + * The ID of the vector store file. + */ + file_id: string; + /** + * The name of the vector store file. + */ + filename: string; + /** + * The similarity score for the result. + */ + score: number; + attributes: VectorStoreFileAttributes; + /** + * Content chunks from the file. + */ + content: Array; }; export type VectorStoreSearchResultsPage = { - /** - * The object type, which is always `vector_store.search_results.page` - */ - object: 'vector_store.search_results.page'; - search_query: Array; - /** - * The list of search result items. - */ - data: Array; - /** - * Indicates if there are more results to fetch. - */ - has_more: boolean; - /** - * The token for the next page, if any. - */ - next_page: string; + /** + * The object type, which is always `vector_store.search_results.page` + */ + object: 'vector_store.search_results.page'; + search_query: Array; + /** + * The list of search result items. + */ + data: Array; + /** + * Indicates if there are more results to fetch. + */ + has_more: boolean; + /** + * The token for the next page, if any. + */ + next_page: string; }; /** @@ -16374,9 +16891,9 @@ export type VectorStoreSearchResultsPage = { * */ export const Verbosity = { - LOW: 'low', - MEDIUM: 'medium', - HIGH: 'high' + LOW: 'low', + MEDIUM: 'medium', + HIGH: 'high', } as const; /** @@ -16385,9 +16902,18 @@ export const Verbosity = { * Currently supported values are `low`, `medium`, and `high`. * */ -export type Verbosity = typeof Verbosity[keyof typeof Verbosity]; +export type Verbosity = (typeof Verbosity)[keyof typeof Verbosity]; -export type VoiceIdsShared = string | 'alloy' | 'ash' | 'ballad' | 'coral' | 'echo' | 'sage' | 'shimmer' | 'verse'; +export type VoiceIdsShared = + | string + | 'alloy' + | 'ash' + | 'ballad' + | 'coral' + | 'echo' + | 'sage' + | 'shimmer' + | 'verse'; /** * Wait @@ -16396,12 +16922,12 @@ export type VoiceIdsShared = string | 'alloy' | 'ash' | 'ballad' | 'coral' | 'ec * */ export type Wait = { - /** - * Specifies the event type. For a wait action, this property is - * always set to `wait`. - * - */ - type: 'wait'; + /** + * Specifies the event type. For a wait action, this property is + * always set to `wait`. + * + */ + type: 'wait'; }; /** @@ -16411,21 +16937,21 @@ export type Wait = { * */ export type WebSearchActionFind = { - /** - * The action type. - * - */ - type: 'find'; - /** - * The URL of the page searched for the pattern. - * - */ - url: string; - /** - * The pattern or text to search for within the page. - * - */ - pattern: string; + /** + * The action type. + * + */ + type: 'find'; + /** + * The URL of the page searched for the pattern. + * + */ + url: string; + /** + * The pattern or text to search for within the page. + * + */ + pattern: string; }; /** @@ -16435,16 +16961,16 @@ export type WebSearchActionFind = { * */ export type WebSearchActionOpenPage = { - /** - * The action type. - * - */ - type: 'open_page'; - /** - * The URL opened by the model. - * - */ - url: string; + /** + * The action type. + * + */ + type: 'open_page'; + /** + * The URL opened by the model. + * + */ + url: string; }; /** @@ -16454,16 +16980,16 @@ export type WebSearchActionOpenPage = { * */ export type WebSearchActionSearch = { - /** - * The action type. - * - */ - type: 'search'; - /** - * The search query. - * - */ - query: string; + /** + * The action type. + * + */ + type: 'search'; + /** + * The search query. + * + */ + query: string; }; /** @@ -16472,9 +16998,9 @@ export type WebSearchActionSearch = { * */ export const WebSearchContextSize = { - LOW: 'low', - MEDIUM: 'medium', - HIGH: 'high' + LOW: 'low', + MEDIUM: 'medium', + HIGH: 'high', } as const; /** @@ -16482,7 +17008,7 @@ export const WebSearchContextSize = { * search. One of `low`, `medium`, or `high`. `medium` is the default. * */ -export type WebSearchContextSize = typeof WebSearchContextSize[keyof typeof WebSearchContextSize]; +export type WebSearchContextSize = (typeof WebSearchContextSize)[keyof typeof WebSearchContextSize]; /** * Web search location @@ -16490,29 +17016,29 @@ export type WebSearchContextSize = typeof WebSearchContextSize[keyof typeof WebS * Approximate location parameters for the search. */ export type WebSearchLocation = { - /** - * The two-letter - * [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, - * e.g. `US`. - * - */ - country?: string; - /** - * Free text input for the region of the user, e.g. `California`. - * - */ - region?: string; - /** - * Free text input for the city of the user, e.g. `San Francisco`. - * - */ - city?: string; - /** - * The [IANA timezone](https://timeapi.io/documentation/iana-timezones) - * of the user, e.g. `America/Los_Angeles`. - * - */ - timezone?: string; + /** + * The two-letter + * [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, + * e.g. `US`. + * + */ + country?: string; + /** + * Free text input for the region of the user, e.g. `California`. + * + */ + region?: string; + /** + * Free text input for the city of the user, e.g. `San Francisco`. + * + */ + city?: string; + /** + * The [IANA timezone](https://timeapi.io/documentation/iana-timezones) + * of the user, e.g. `America/Los_Angeles`. + * + */ + timezone?: string; }; /** @@ -16523,33 +17049,36 @@ export type WebSearchLocation = { * */ export type WebSearchToolCall = { - /** - * The unique ID of the web search tool call. - * - */ - id: string; - /** - * The type of the web search tool call. Always `web_search_call`. - * - */ - type: 'web_search_call'; - /** - * The status of the web search tool call. - * - */ - status: 'in_progress' | 'searching' | 'completed' | 'failed'; - /** - * An object describing the specific action taken in this web search call. - * Includes details on how the model used the web (search, open_page, find). - * - */ - action: ({ + /** + * The unique ID of the web search tool call. + * + */ + id: string; + /** + * The type of the web search tool call. Always `web_search_call`. + * + */ + type: 'web_search_call'; + /** + * The status of the web search tool call. + * + */ + status: 'in_progress' | 'searching' | 'completed' | 'failed'; + /** + * An object describing the specific action taken in this web search call. + * Includes details on how the model used the web (search, open_page, find). + * + */ + action: + | ({ type?: 'WebSearchActionSearch'; - } & WebSearchActionSearch) | ({ + } & WebSearchActionSearch) + | ({ type?: 'WebSearchActionOpenPage'; - } & WebSearchActionOpenPage) | ({ + } & WebSearchActionOpenPage) + | ({ type?: 'WebSearchActionFind'; - } & WebSearchActionFind); + } & WebSearchActionFind); }; /** @@ -16559,37 +17088,37 @@ export type WebSearchToolCall = { * */ export type WebhookBatchCancelled = { - /** - * The Unix timestamp (in seconds) of when the batch API request was cancelled. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the batch API request was cancelled. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the batch API request. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the batch API request. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `batch.cancelled`. - * - */ - type: 'batch.cancelled'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `batch.cancelled`. + * + */ + type: 'batch.cancelled'; }; /** @@ -16599,117 +17128,117 @@ export type WebhookBatchCancelled = { * */ export type WebhookBatchCompleted = { - /** - * The Unix timestamp (in seconds) of when the batch API request was completed. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the batch API request was completed. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the batch API request. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the batch API request. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `batch.completed`. - * - */ - type: 'batch.completed'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `batch.completed`. + * + */ + type: 'batch.completed'; }; /** * batch.expired * * Sent when a batch API request has expired. - * - */ -export type WebhookBatchExpired = { - /** - * The Unix timestamp (in seconds) of when the batch API request expired. - * - */ - created_at: number; - /** - * The unique ID of the event. - * - */ - id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the batch API request. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `batch.expired`. - * - */ - type: 'batch.expired'; -}; - -/** - * batch.failed - * - * Sent when a batch API request has failed. - * - */ -export type WebhookBatchFailed = { - /** - * The Unix timestamp (in seconds) of when the batch API request failed. - * - */ - created_at: number; - /** - * The unique ID of the event. - * - */ - id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the batch API request. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. + * + */ +export type WebhookBatchExpired = { + /** + * The Unix timestamp (in seconds) of when the batch API request expired. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the batch API request. * */ - object?: 'event'; - /** - * The type of the event. Always `batch.failed`. + id: string; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `batch.expired`. + * + */ + type: 'batch.expired'; +}; + +/** + * batch.failed + * + * Sent when a batch API request has failed. + * + */ +export type WebhookBatchFailed = { + /** + * The Unix timestamp (in seconds) of when the batch API request failed. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the batch API request. * */ - type: 'batch.failed'; + id: string; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `batch.failed`. + * + */ + type: 'batch.failed'; }; /** @@ -16719,37 +17248,37 @@ export type WebhookBatchFailed = { * */ export type WebhookEvalRunCanceled = { - /** - * The Unix timestamp (in seconds) of when the eval run was canceled. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the eval run was canceled. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the eval run. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the eval run. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `eval.run.canceled`. - * - */ - type: 'eval.run.canceled'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `eval.run.canceled`. + * + */ + type: 'eval.run.canceled'; }; /** @@ -16759,37 +17288,37 @@ export type WebhookEvalRunCanceled = { * */ export type WebhookEvalRunFailed = { - /** - * The Unix timestamp (in seconds) of when the eval run failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the eval run failed. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the eval run. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the eval run. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `eval.run.failed`. - * - */ - type: 'eval.run.failed'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `eval.run.failed`. + * + */ + type: 'eval.run.failed'; }; /** @@ -16799,37 +17328,37 @@ export type WebhookEvalRunFailed = { * */ export type WebhookEvalRunSucceeded = { - /** - * The Unix timestamp (in seconds) of when the eval run succeeded. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the eval run succeeded. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the eval run. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the eval run. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `eval.run.succeeded`. - * - */ - type: 'eval.run.succeeded'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `eval.run.succeeded`. + * + */ + type: 'eval.run.succeeded'; }; /** @@ -16839,37 +17368,37 @@ export type WebhookEvalRunSucceeded = { * */ export type WebhookFineTuningJobCancelled = { - /** - * The Unix timestamp (in seconds) of when the fine-tuning job was cancelled. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the fine-tuning job was cancelled. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the fine-tuning job. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the fine-tuning job. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `fine_tuning.job.cancelled`. - * - */ - type: 'fine_tuning.job.cancelled'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `fine_tuning.job.cancelled`. + * + */ + type: 'fine_tuning.job.cancelled'; }; /** @@ -16879,37 +17408,37 @@ export type WebhookFineTuningJobCancelled = { * */ export type WebhookFineTuningJobFailed = { - /** - * The Unix timestamp (in seconds) of when the fine-tuning job failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the fine-tuning job failed. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the fine-tuning job. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the fine-tuning job. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `fine_tuning.job.failed`. - * - */ - type: 'fine_tuning.job.failed'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `fine_tuning.job.failed`. + * + */ + type: 'fine_tuning.job.failed'; }; /** @@ -16919,37 +17448,37 @@ export type WebhookFineTuningJobFailed = { * */ export type WebhookFineTuningJobSucceeded = { - /** - * The Unix timestamp (in seconds) of when the fine-tuning job succeeded. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the fine-tuning job succeeded. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the fine-tuning job. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the fine-tuning job. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `fine_tuning.job.succeeded`. - * - */ - type: 'fine_tuning.job.succeeded'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `fine_tuning.job.succeeded`. + * + */ + type: 'fine_tuning.job.succeeded'; }; /** @@ -16959,37 +17488,37 @@ export type WebhookFineTuningJobSucceeded = { * */ export type WebhookResponseCancelled = { - /** - * The Unix timestamp (in seconds) of when the model response was cancelled. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the model response was cancelled. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the model response. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the model response. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `response.cancelled`. - * - */ - type: 'response.cancelled'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `response.cancelled`. + * + */ + type: 'response.cancelled'; }; /** @@ -16999,37 +17528,37 @@ export type WebhookResponseCancelled = { * */ export type WebhookResponseCompleted = { - /** - * The Unix timestamp (in seconds) of when the model response was completed. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the model response was completed. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the model response. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the model response. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `response.completed`. - * - */ - type: 'response.completed'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `response.completed`. + * + */ + type: 'response.completed'; }; /** @@ -17039,37 +17568,37 @@ export type WebhookResponseCompleted = { * */ export type WebhookResponseFailed = { - /** - * The Unix timestamp (in seconds) of when the model response failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the model response failed. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the model response. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the model response. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `response.failed`. - * - */ - type: 'response.failed'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `response.failed`. + * + */ + type: 'response.failed'; }; /** @@ -17079,37 +17608,37 @@ export type WebhookResponseFailed = { * */ export type WebhookResponseIncomplete = { - /** - * The Unix timestamp (in seconds) of when the model response was interrupted. - * - */ - created_at: number; - /** - * The unique ID of the event. + /** + * The Unix timestamp (in seconds) of when the model response was interrupted. + * + */ + created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * Event data payload. + * + */ + data: { + /** + * The unique ID of the model response. * */ id: string; - /** - * Event data payload. - * - */ - data: { - /** - * The unique ID of the model response. - * - */ - id: string; - }; - /** - * The object of the event. Always `event`. - * - */ - object?: 'event'; - /** - * The type of the event. Always `response.incomplete`. - * - */ - type: 'response.incomplete'; + }; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `response.incomplete`. + * + */ + type: 'response.incomplete'; }; /** @@ -17118,14 +17647,14 @@ export type WebhookResponseIncomplete = { * A text input to the model. */ export type InputTextContent = { - /** - * The type of the input item. Always `input_text`. - */ - type: 'input_text'; - /** - * The text input to the model. - */ - text: string; + /** + * The type of the input item. Always `input_text`. + */ + type: 'input_text'; + /** + * The text input to the model. + */ + text: string; }; /** @@ -17134,16 +17663,16 @@ export type InputTextContent = { * An image input to the model. Learn about [image inputs](https://platform.openai.com/docs/guides/vision). */ export type InputImageContent = { - /** - * The type of the input item. Always `input_image`. - */ - type: 'input_image'; - image_url?: string | null; - file_id?: string | null; - /** - * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. - */ - detail: 'low' | 'high' | 'auto'; + /** + * The type of the input item. Always `input_image`. + */ + type: 'input_image'; + image_url?: string | null; + file_id?: string | null; + /** + * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + */ + detail: 'low' | 'high' | 'auto'; }; /** @@ -17152,24 +17681,24 @@ export type InputImageContent = { * A file input to the model. */ export type InputFileContent = { - /** - * The type of the input item. Always `input_file`. - */ - type: 'input_file'; - file_id?: string | null; - /** - * The name of the file to be sent to the model. - */ - filename?: string; - /** - * The URL of the file to be sent to the model. - */ - file_url?: string; - /** - * The content of the file to be sent to the model. - * - */ - file_data?: string; + /** + * The type of the input item. Always `input_file`. + */ + type: 'input_file'; + file_id?: string | null; + /** + * The name of the file to be sent to the model. + */ + filename?: string; + /** + * The URL of the file to be sent to the model. + */ + file_url?: string; + /** + * The content of the file to be sent to the model. + * + */ + file_data?: string; }; /** @@ -17178,30 +17707,30 @@ export type InputFileContent = { * Defines a function in your own code the model can choose to call. Learn more about [function calling](https://platform.openai.com/docs/guides/function-calling). */ export type FunctionTool = { - /** - * The type of the function tool. Always `function`. - */ - type: 'function'; - /** - * The name of the function to call. - */ - name: string; - description?: string | null; - parameters: { - [key: string]: unknown; - } | null; - strict: boolean | null; + /** + * The type of the function tool. Always `function`. + */ + type: 'function'; + /** + * The name of the function to call. + */ + name: string; + description?: string | null; + parameters: { + [key: string]: unknown; + } | null; + strict: boolean | null; }; export type RankingOptions = { - /** - * The ranker to use for the file search. - */ - ranker?: 'auto' | 'default-2024-11-15'; - /** - * The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. - */ - score_threshold?: number; + /** + * The ranker to use for the file search. + */ + ranker?: 'auto' | 'default-2024-11-15'; + /** + * The score threshold for the file search, a number between 0 and 1. Numbers closer to 1 will attempt to return only the most relevant results, but may return fewer results. + */ + score_threshold?: number; }; export type Filters = ComparisonFilter | CompoundFilter; @@ -17212,34 +17741,34 @@ export type Filters = ComparisonFilter | CompoundFilter; * A tool that searches for relevant content from uploaded files. Learn more about the [file search tool](https://platform.openai.com/docs/guides/tools-file-search). */ export type FileSearchTool = { - /** - * The type of the file search tool. Always `file_search`. - */ - type: 'file_search'; - /** - * The IDs of the vector stores to search. - */ - vector_store_ids: Array; - /** - * The maximum number of results to return. This number should be between 1 and 50 inclusive. - */ - max_num_results?: number; - /** - * Ranking options for search. - */ - ranking_options?: RankingOptions; - filters?: Filters | null; + /** + * The type of the file search tool. Always `file_search`. + */ + type: 'file_search'; + /** + * The IDs of the vector stores to search. + */ + vector_store_ids: Array; + /** + * The maximum number of results to return. This number should be between 1 and 50 inclusive. + */ + max_num_results?: number; + /** + * Ranking options for search. + */ + ranking_options?: RankingOptions; + filters?: Filters | null; }; export type ApproximateLocation = { - /** - * The type of location approximation. Always `approximate`. - */ - type: 'approximate'; - country?: string | null; - region?: string | null; - city?: string | null; - timezone?: string | null; + /** + * The type of location approximation. Always `approximate`. + */ + type: 'approximate'; + country?: string | null; + region?: string | null; + city?: string | null; + timezone?: string | null; }; /** @@ -17248,39 +17777,39 @@ export type ApproximateLocation = { * This tool searches the web for relevant results to use in a response. Learn more about the [web search tool](https://platform.openai.com/docs/guides/tools-web-search). */ export type WebSearchPreviewTool = { - /** - * The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. - */ - type: 'web_search_preview' | 'web_search_preview_2025_03_11'; - user_location?: ApproximateLocation | null; - /** - * High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. - */ - search_context_size?: 'low' | 'medium' | 'high'; + /** + * The type of the web search tool. One of `web_search_preview` or `web_search_preview_2025_03_11`. + */ + type: 'web_search_preview' | 'web_search_preview_2025_03_11'; + user_location?: ApproximateLocation | null; + /** + * High level guidance for the amount of context window space to use for the search. One of `low`, `medium`, or `high`. `medium` is the default. + */ + search_context_size?: 'low' | 'medium' | 'high'; }; -/** - * Computer use preview - * - * A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). - */ -export type ComputerUsePreviewTool = { - /** - * The type of the computer use tool. Always `computer_use_preview`. - */ - type: 'computer_use_preview'; - /** - * The type of computer environment to control. - */ - environment: 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser'; - /** - * The width of the computer display. - */ - display_width: number; - /** - * The height of the computer display. - */ - display_height: number; +/** + * Computer use preview + * + * A tool that controls a virtual computer. Learn more about the [computer tool](https://platform.openai.com/docs/guides/tools-computer-use). + */ +export type ComputerUsePreviewTool = { + /** + * The type of the computer use tool. Always `computer_use_preview`. + */ + type: 'computer_use_preview'; + /** + * The type of computer environment to control. + */ + environment: 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser'; + /** + * The width of the computer display. + */ + display_width: number; + /** + * The height of the computer display. + */ + display_height: number; }; /** @@ -17289,14 +17818,14 @@ export type ComputerUsePreviewTool = { * The input tokens detailed information for the image generation. */ export type ImageGenInputUsageDetails = { - /** - * The number of text tokens in the input prompt. - */ - text_tokens: number; - /** - * The number of image tokens in the input prompt. - */ - image_tokens: number; + /** + * The number of text tokens in the input prompt. + */ + text_tokens: number; + /** + * The number of image tokens in the input prompt. + */ + image_tokens: number; }; /** @@ -17305,19 +17834,19 @@ export type ImageGenInputUsageDetails = { * For `gpt-image-1` only, the token usage information for the image generation. */ export type ImageGenUsage = { - /** - * The number of tokens (images and text) in the input prompt. - */ - input_tokens: number; - /** - * The total number of tokens (images and text) used for the image generation. - */ - total_tokens: number; - /** - * The number of output tokens generated by the model. - */ - output_tokens: number; - input_tokens_details: ImageGenInputUsageDetails; + /** + * The number of tokens (images and text) in the input prompt. + */ + input_tokens: number; + /** + * The total number of tokens (images and text) used for the image generation. + */ + total_tokens: number; + /** + * The number of output tokens generated by the model. + */ + output_tokens: number; + input_tokens_details: ImageGenInputUsageDetails; }; /** @@ -17326,22 +17855,22 @@ export type ImageGenUsage = { * A citation to a file. */ export type FileCitationBody = { - /** - * The type of the file citation. Always `file_citation`. - */ - type: 'file_citation'; - /** - * The ID of the file. - */ - file_id: string; - /** - * The index of the file in the list of files. - */ - index: number; - /** - * The filename of the file cited. - */ - filename: string; + /** + * The type of the file citation. Always `file_citation`. + */ + type: 'file_citation'; + /** + * The ID of the file. + */ + file_id: string; + /** + * The index of the file in the list of files. + */ + index: number; + /** + * The filename of the file cited. + */ + filename: string; }; /** @@ -17350,26 +17879,26 @@ export type FileCitationBody = { * A citation for a web resource used to generate a model response. */ export type UrlCitationBody = { - /** - * The type of the URL citation. Always `url_citation`. - */ - type: 'url_citation'; - /** - * The URL of the web resource. - */ - url: string; - /** - * The index of the first character of the URL citation in the message. - */ - start_index: number; - /** - * The index of the last character of the URL citation in the message. - */ - end_index: number; - /** - * The title of the web resource. - */ - title: string; + /** + * The type of the URL citation. Always `url_citation`. + */ + type: 'url_citation'; + /** + * The URL of the web resource. + */ + url: string; + /** + * The index of the first character of the URL citation in the message. + */ + start_index: number; + /** + * The index of the last character of the URL citation in the message. + */ + end_index: number; + /** + * The title of the web resource. + */ + title: string; }; /** @@ -17378,41 +17907,45 @@ export type UrlCitationBody = { * A citation for a container file used to generate a model response. */ export type ContainerFileCitationBody = { - /** - * The type of the container file citation. Always `container_file_citation`. - */ - type: 'container_file_citation'; - /** - * The ID of the container file. - */ - container_id: string; - /** - * The ID of the file. - */ - file_id: string; - /** - * The index of the first character of the container file citation in the message. - */ - start_index: number; - /** - * The index of the last character of the container file citation in the message. - */ - end_index: number; - /** - * The filename of the container file cited. - */ - filename: string; -}; - -export type Annotation = ({ - type?: 'FileCitationBody'; -} & FileCitationBody) | ({ - type?: 'UrlCitationBody'; -} & UrlCitationBody) | ({ - type?: 'ContainerFileCitationBody'; -} & ContainerFileCitationBody) | ({ - type?: 'FilePath'; -} & FilePath); + /** + * The type of the container file citation. Always `container_file_citation`. + */ + type: 'container_file_citation'; + /** + * The ID of the container file. + */ + container_id: string; + /** + * The ID of the file. + */ + file_id: string; + /** + * The index of the first character of the container file citation in the message. + */ + start_index: number; + /** + * The index of the last character of the container file citation in the message. + */ + end_index: number; + /** + * The filename of the container file cited. + */ + filename: string; +}; + +export type Annotation = + | ({ + type?: 'FileCitationBody'; + } & FileCitationBody) + | ({ + type?: 'UrlCitationBody'; + } & UrlCitationBody) + | ({ + type?: 'ContainerFileCitationBody'; + } & ContainerFileCitationBody) + | ({ + type?: 'FilePath'; + } & FilePath); /** * Top log probability @@ -17420,9 +17953,9 @@ export type Annotation = ({ * The top log probability of a token. */ export type TopLogProb = { - token: string; - logprob: number; - bytes: Array; + token: string; + logprob: number; + bytes: Array; }; /** @@ -17431,10 +17964,10 @@ export type TopLogProb = { * The log probability of a token. */ export type LogProb = { - token: string; - logprob: number; - bytes: Array; - top_logprobs: Array; + token: string; + logprob: number; + bytes: Array; + top_logprobs: Array; }; /** @@ -17443,19 +17976,19 @@ export type LogProb = { * A text output from the model. */ export type OutputTextContent = { - /** - * The type of the output text. Always `output_text`. - */ - type: 'output_text'; - /** - * The text output from the model. - */ - text: string; - /** - * The annotations of the text output. - */ - annotations: Array; - logprobs?: Array; + /** + * The type of the output text. Always `output_text`. + */ + type: 'output_text'; + /** + * The text output from the model. + */ + text: string; + /** + * The annotations of the text output. + */ + annotations: Array; + logprobs?: Array; }; /** @@ -17464,26 +17997,26 @@ export type OutputTextContent = { * A refusal from the model. */ export type RefusalContent = { - /** - * The type of the refusal. Always `refusal`. - */ - type: 'refusal'; - /** - * The refusal explanation from the model. - */ - refusal: string; + /** + * The type of the refusal. Always `refusal`. + */ + type: 'refusal'; + /** + * The refusal explanation from the model. + */ + refusal: string; }; /** * A pending safety check for the computer call. */ export type ComputerCallSafetyCheckParam = { - /** - * The ID of the pending safety check. - */ - id: string; - code?: string | null; - message?: string | null; + /** + * The ID of the pending safety check. + */ + id: string; + code?: string | null; + message?: string | null; }; /** @@ -17492,18 +18025,18 @@ export type ComputerCallSafetyCheckParam = { * The output of a computer tool call. */ export type ComputerCallOutputItemParam = { - id?: string | null; - /** - * The ID of the computer tool call that produced the output. - */ - call_id: string; - /** - * The type of the computer tool call output. Always `computer_call_output`. - */ - type: 'computer_call_output'; - output: ComputerScreenshotImage; - acknowledged_safety_checks?: Array | null; - status?: 'in_progress' | 'completed' | 'incomplete' | null; + id?: string | null; + /** + * The ID of the computer tool call that produced the output. + */ + call_id: string; + /** + * The type of the computer tool call output. Always `computer_call_output`. + */ + type: 'computer_call_output'; + output: ComputerScreenshotImage; + acknowledged_safety_checks?: Array | null; + status?: 'in_progress' | 'completed' | 'incomplete' | null; }; /** @@ -17512,20 +18045,20 @@ export type ComputerCallOutputItemParam = { * The output of a function tool call. */ export type FunctionCallOutputItemParam = { - id?: string | null; - /** - * The unique ID of the function tool call generated by the model. - */ - call_id: string; - /** - * The type of the function tool call output. Always `function_call_output`. - */ - type: 'function_call_output'; - /** - * A JSON string of the output of the function tool call. - */ - output: string; - status?: 'in_progress' | 'completed' | 'incomplete' | null; + id?: string | null; + /** + * The unique ID of the function tool call generated by the model. + */ + call_id: string; + /** + * The type of the function tool call output. Always `function_call_output`. + */ + type: 'function_call_output'; + /** + * A JSON string of the output of the function tool call. + */ + output: string; + status?: 'in_progress' | 'completed' | 'incomplete' | null; }; /** @@ -17534,4922 +18067,5061 @@ export type FunctionCallOutputItemParam = { * An internal identifier for an item to reference. */ export type ItemReferenceParam = { - type?: 'item_reference' | null; - /** - * The ID of the item to reference. - */ - id: string; + type?: 'item_reference' | null; + /** + * The ID of the item to reference. + */ + id: string; }; export type RealtimeConversationItemContent = { - /** - * The content type (`input_text`, `input_audio`, `item_reference`, `text`, `audio`). - * - */ - type?: 'input_text' | 'input_audio' | 'item_reference' | 'text' | 'audio'; - /** - * The text content, used for `input_text` and `text` content types. - * - */ - text?: string; - /** - * ID of a previous conversation item to reference (for `item_reference` - * content types in `response.create` events). These can reference both - * client and server created items. - * - */ - id?: string; - /** - * Base64-encoded audio bytes, used for `input_audio` content type. - * - */ - audio?: string; - /** - * The transcript of the audio, used for `input_audio` and `audio` - * content types. - * - */ - transcript?: string; + /** + * The content type (`input_text`, `input_audio`, `item_reference`, `text`, `audio`). + * + */ + type?: 'input_text' | 'input_audio' | 'item_reference' | 'text' | 'audio'; + /** + * The text content, used for `input_text` and `text` content types. + * + */ + text?: string; + /** + * ID of a previous conversation item to reference (for `item_reference` + * content types in `response.create` events). These can reference both + * client and server created items. + * + */ + id?: string; + /** + * Base64-encoded audio bytes, used for `input_audio` content type. + * + */ + audio?: string; + /** + * The transcript of the audio, used for `input_audio` and `audio` + * content types. + * + */ + transcript?: string; }; export type RealtimeConnectParams = { - model: string; + model: string; }; /** * An object describing an image to classify. */ export type ModerationImageUrlInput = { + /** + * Always `image_url`. + */ + type: 'image_url'; + /** + * Contains either an image URL or a data URL for a base64 encoded image. + */ + image_url: { /** - * Always `image_url`. - */ - type: 'image_url'; - /** - * Contains either an image URL or a data URL for a base64 encoded image. + * Either a URL of the image or the base64 encoded image data. */ - image_url: { - /** - * Either a URL of the image or the base64 encoded image data. - */ - url: string; - }; + url: string; + }; }; /** * An object describing text to classify. */ export type ModerationTextInput = { - /** - * Always `text`. - */ - type: 'text'; - /** - * A string of text to classify. - */ - text: string; + /** + * Always `text`. + */ + type: 'text'; + /** + * A string of text to classify. + */ + text: string; }; /** * The strategy used to chunk the file. */ -export type ChunkingStrategyResponse = ({ - type?: 'StaticChunkingStrategyResponseParam'; -} & StaticChunkingStrategyResponseParam) | ({ - type?: 'OtherChunkingStrategyResponseParam'; -} & OtherChunkingStrategyResponseParam); +export type ChunkingStrategyResponse = + | ({ + type?: 'StaticChunkingStrategyResponseParam'; + } & StaticChunkingStrategyResponseParam) + | ({ + type?: 'OtherChunkingStrategyResponseParam'; + } & OtherChunkingStrategyResponseParam); /** * The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`: Flexible file type for any purpose - `evals`: Used for eval data sets * */ export const FilePurpose = { - ASSISTANTS: 'assistants', - BATCH: 'batch', - FINE_TUNE: 'fine-tune', - VISION: 'vision', - USER_DATA: 'user_data', - EVALS: 'evals' + ASSISTANTS: 'assistants', + BATCH: 'batch', + FINE_TUNE: 'fine-tune', + VISION: 'vision', + USER_DATA: 'user_data', + EVALS: 'evals', } as const; /** * The intended purpose of the uploaded file. One of: - `assistants`: Used in the Assistants API - `batch`: Used in the Batch API - `fine-tune`: Used for fine-tuning - `vision`: Images used for vision fine-tuning - `user_data`: Flexible file type for any purpose - `evals`: Used for eval data sets * */ -export type FilePurpose = typeof FilePurpose[keyof typeof FilePurpose]; +export type FilePurpose = (typeof FilePurpose)[keyof typeof FilePurpose]; export type BatchError = { - /** - * An error code identifying the error type. - */ - code?: string; - /** - * A human-readable message providing more details about the error. - */ - message?: string; - /** - * The name of the parameter that caused the error, if applicable. - */ - param?: string; - /** - * The line number of the input file where the error occurred, if applicable. - */ - line?: number; + /** + * An error code identifying the error type. + */ + code?: string; + /** + * A human-readable message providing more details about the error. + */ + message?: string; + /** + * The name of the parameter that caused the error, if applicable. + */ + param?: string; + /** + * The line number of the input file where the error occurred, if applicable. + */ + line?: number; }; /** * The request counts for different statuses within the batch. */ export type BatchRequestCounts = { - /** - * Total number of requests in the batch. - */ - total: number; - /** - * Number of requests that have been completed successfully. - */ - completed: number; - /** - * Number of requests that have failed. - */ - failed: number; -}; - -export type AssistantTool = ({ - type?: 'AssistantToolsCode'; -} & AssistantToolsCode) | ({ - type?: 'AssistantToolsFileSearch'; -} & AssistantToolsFileSearch) | ({ - type?: 'AssistantToolsFunction'; -} & AssistantToolsFunction); - -export type TextAnnotationDelta = ({ - type?: 'MessageDeltaContentTextAnnotationsFileCitationObject'; -} & MessageDeltaContentTextAnnotationsFileCitationObject) | ({ - type?: 'MessageDeltaContentTextAnnotationsFilePathObject'; -} & MessageDeltaContentTextAnnotationsFilePathObject); - -export type TextAnnotation = ({ - type?: 'MessageContentTextAnnotationsFileCitationObject'; -} & MessageContentTextAnnotationsFileCitationObject) | ({ - type?: 'MessageContentTextAnnotationsFilePathObject'; -} & MessageContentTextAnnotationsFilePathObject); - -export type RunStepDetailsToolCall = ({ - type?: 'RunStepDetailsToolCallsCodeObject'; -} & RunStepDetailsToolCallsCodeObject) | ({ - type?: 'RunStepDetailsToolCallsFileSearchObject'; -} & RunStepDetailsToolCallsFileSearchObject) | ({ - type?: 'RunStepDetailsToolCallsFunctionObject'; -} & RunStepDetailsToolCallsFunctionObject); - -export type RunStepDeltaStepDetailsToolCall = ({ - type?: 'RunStepDeltaStepDetailsToolCallsCodeObject'; -} & RunStepDeltaStepDetailsToolCallsCodeObject) | ({ - type?: 'RunStepDeltaStepDetailsToolCallsFileSearchObject'; -} & RunStepDeltaStepDetailsToolCallsFileSearchObject) | ({ - type?: 'RunStepDeltaStepDetailsToolCallsFunctionObject'; -} & RunStepDeltaStepDetailsToolCallsFunctionObject); - -export type MessageContent = ({ - type?: 'MessageContentImageFileObject'; -} & MessageContentImageFileObject) | ({ - type?: 'MessageContentImageUrlObject'; -} & MessageContentImageUrlObject) | ({ - type?: 'MessageContentTextObject'; -} & MessageContentTextObject) | ({ - type?: 'MessageContentRefusalObject'; -} & MessageContentRefusalObject); - -export type MessageContentDelta = ({ - type?: 'MessageDeltaContentImageFileObject'; -} & MessageDeltaContentImageFileObject) | ({ - type?: 'MessageDeltaContentTextObject'; -} & MessageDeltaContentTextObject) | ({ - type?: 'MessageDeltaContentRefusalObject'; -} & MessageDeltaContentRefusalObject) | ({ - type?: 'MessageDeltaContentImageUrlObject'; -} & MessageDeltaContentImageUrlObject); + /** + * Total number of requests in the batch. + */ + total: number; + /** + * Number of requests that have been completed successfully. + */ + completed: number; + /** + * Number of requests that have failed. + */ + failed: number; +}; + +export type AssistantTool = + | ({ + type?: 'AssistantToolsCode'; + } & AssistantToolsCode) + | ({ + type?: 'AssistantToolsFileSearch'; + } & AssistantToolsFileSearch) + | ({ + type?: 'AssistantToolsFunction'; + } & AssistantToolsFunction); + +export type TextAnnotationDelta = + | ({ + type?: 'MessageDeltaContentTextAnnotationsFileCitationObject'; + } & MessageDeltaContentTextAnnotationsFileCitationObject) + | ({ + type?: 'MessageDeltaContentTextAnnotationsFilePathObject'; + } & MessageDeltaContentTextAnnotationsFilePathObject); + +export type TextAnnotation = + | ({ + type?: 'MessageContentTextAnnotationsFileCitationObject'; + } & MessageContentTextAnnotationsFileCitationObject) + | ({ + type?: 'MessageContentTextAnnotationsFilePathObject'; + } & MessageContentTextAnnotationsFilePathObject); + +export type RunStepDetailsToolCall = + | ({ + type?: 'RunStepDetailsToolCallsCodeObject'; + } & RunStepDetailsToolCallsCodeObject) + | ({ + type?: 'RunStepDetailsToolCallsFileSearchObject'; + } & RunStepDetailsToolCallsFileSearchObject) + | ({ + type?: 'RunStepDetailsToolCallsFunctionObject'; + } & RunStepDetailsToolCallsFunctionObject); + +export type RunStepDeltaStepDetailsToolCall = + | ({ + type?: 'RunStepDeltaStepDetailsToolCallsCodeObject'; + } & RunStepDeltaStepDetailsToolCallsCodeObject) + | ({ + type?: 'RunStepDeltaStepDetailsToolCallsFileSearchObject'; + } & RunStepDeltaStepDetailsToolCallsFileSearchObject) + | ({ + type?: 'RunStepDeltaStepDetailsToolCallsFunctionObject'; + } & RunStepDeltaStepDetailsToolCallsFunctionObject); + +export type MessageContent = + | ({ + type?: 'MessageContentImageFileObject'; + } & MessageContentImageFileObject) + | ({ + type?: 'MessageContentImageUrlObject'; + } & MessageContentImageUrlObject) + | ({ + type?: 'MessageContentTextObject'; + } & MessageContentTextObject) + | ({ + type?: 'MessageContentRefusalObject'; + } & MessageContentRefusalObject); + +export type MessageContentDelta = + | ({ + type?: 'MessageDeltaContentImageFileObject'; + } & MessageDeltaContentImageFileObject) + | ({ + type?: 'MessageDeltaContentTextObject'; + } & MessageDeltaContentTextObject) + | ({ + type?: 'MessageDeltaContentRefusalObject'; + } & MessageDeltaContentRefusalObject) + | ({ + type?: 'MessageDeltaContentImageUrlObject'; + } & MessageDeltaContentImageUrlObject); export const ChatModel = { - GPT_5: 'gpt-5', - GPT_5_MINI: 'gpt-5-mini', - GPT_5_NANO: 'gpt-5-nano', - GPT_5_2025_08_07: 'gpt-5-2025-08-07', - GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', - GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07', - GPT_5_CHAT_LATEST: 'gpt-5-chat-latest', - GPT_4_1: 'gpt-4.1', - GPT_4_1_MINI: 'gpt-4.1-mini', - GPT_4_1_NANO: 'gpt-4.1-nano', - GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', - GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', - GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', - O4_MINI: 'o4-mini', - O4_MINI_2025_04_16: 'o4-mini-2025-04-16', - O3: 'o3', - O3_2025_04_16: 'o3-2025-04-16', - O3_MINI: 'o3-mini', - O3_MINI_2025_01_31: 'o3-mini-2025-01-31', - O1: 'o1', - O1_2024_12_17: 'o1-2024-12-17', - O1_PREVIEW: 'o1-preview', - O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12', - O1_MINI: 'o1-mini', - O1_MINI_2024_09_12: 'o1-mini-2024-09-12', - GPT_4O: 'gpt-4o', - GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', - GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', - GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', - GPT_4O_AUDIO_PREVIEW: 'gpt-4o-audio-preview', - GPT_4O_AUDIO_PREVIEW_2024_10_01: 'gpt-4o-audio-preview-2024-10-01', - GPT_4O_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-audio-preview-2024-12-17', - GPT_4O_AUDIO_PREVIEW_2025_06_03: 'gpt-4o-audio-preview-2025-06-03', - GPT_4O_MINI_AUDIO_PREVIEW: 'gpt-4o-mini-audio-preview', - GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-mini-audio-preview-2024-12-17', - GPT_4O_SEARCH_PREVIEW: 'gpt-4o-search-preview', - GPT_4O_MINI_SEARCH_PREVIEW: 'gpt-4o-mini-search-preview', - GPT_4O_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-search-preview-2025-03-11', - GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-mini-search-preview-2025-03-11', - CHATGPT_4O_LATEST: 'chatgpt-4o-latest', - CODEX_MINI_LATEST: 'codex-mini-latest', - GPT_4O_MINI: 'gpt-4o-mini', - GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', - GPT_4_TURBO: 'gpt-4-turbo', - GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09', - GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', - GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview', - GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', - GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', - GPT_4: 'gpt-4', - GPT_4_0314: 'gpt-4-0314', - GPT_4_0613: 'gpt-4-0613', - GPT_4_32K: 'gpt-4-32k', - GPT_4_32K_0314: 'gpt-4-32k-0314', - GPT_4_32K_0613: 'gpt-4-32k-0613', - GPT_3_5_TURBO: 'gpt-3.5-turbo', - GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', - GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301', - GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', - GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', - GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', - GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613' + GPT_5: 'gpt-5', + GPT_5_MINI: 'gpt-5-mini', + GPT_5_NANO: 'gpt-5-nano', + GPT_5_2025_08_07: 'gpt-5-2025-08-07', + GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', + GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07', + GPT_5_CHAT_LATEST: 'gpt-5-chat-latest', + GPT_4_1: 'gpt-4.1', + GPT_4_1_MINI: 'gpt-4.1-mini', + GPT_4_1_NANO: 'gpt-4.1-nano', + GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', + GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', + GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', + O4_MINI: 'o4-mini', + O4_MINI_2025_04_16: 'o4-mini-2025-04-16', + O3: 'o3', + O3_2025_04_16: 'o3-2025-04-16', + O3_MINI: 'o3-mini', + O3_MINI_2025_01_31: 'o3-mini-2025-01-31', + O1: 'o1', + O1_2024_12_17: 'o1-2024-12-17', + O1_PREVIEW: 'o1-preview', + O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12', + O1_MINI: 'o1-mini', + O1_MINI_2024_09_12: 'o1-mini-2024-09-12', + GPT_4O: 'gpt-4o', + GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', + GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', + GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', + GPT_4O_AUDIO_PREVIEW: 'gpt-4o-audio-preview', + GPT_4O_AUDIO_PREVIEW_2024_10_01: 'gpt-4o-audio-preview-2024-10-01', + GPT_4O_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-audio-preview-2024-12-17', + GPT_4O_AUDIO_PREVIEW_2025_06_03: 'gpt-4o-audio-preview-2025-06-03', + GPT_4O_MINI_AUDIO_PREVIEW: 'gpt-4o-mini-audio-preview', + GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-mini-audio-preview-2024-12-17', + GPT_4O_SEARCH_PREVIEW: 'gpt-4o-search-preview', + GPT_4O_MINI_SEARCH_PREVIEW: 'gpt-4o-mini-search-preview', + GPT_4O_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-search-preview-2025-03-11', + GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-mini-search-preview-2025-03-11', + CHATGPT_4O_LATEST: 'chatgpt-4o-latest', + CODEX_MINI_LATEST: 'codex-mini-latest', + GPT_4O_MINI: 'gpt-4o-mini', + GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', + GPT_4_TURBO: 'gpt-4-turbo', + GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09', + GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', + GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview', + GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', + GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', + GPT_4: 'gpt-4', + GPT_4_0314: 'gpt-4-0314', + GPT_4_0613: 'gpt-4-0613', + GPT_4_32K: 'gpt-4-32k', + GPT_4_32K_0314: 'gpt-4-32k-0314', + GPT_4_32K_0613: 'gpt-4-32k-0613', + GPT_3_5_TURBO: 'gpt-3.5-turbo', + GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', + GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301', + GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', + GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', + GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', + GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613', } as const; -export type ChatModel = typeof ChatModel[keyof typeof ChatModel]; +export type ChatModel = (typeof ChatModel)[keyof typeof ChatModel]; export type CreateThreadAndRunRequestWithoutStream = { - /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - */ - assistant_id: string; - thread?: CreateThreadRequest; - /** - * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - */ - model?: string | 'gpt-5' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-5-2025-08-07' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4o-mini' | 'gpt-4o-mini-2024-07-18' | 'gpt-4.5-preview' | 'gpt-4.5-preview-2025-02-27' | 'gpt-4-turbo' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-0125-preview' | 'gpt-4-turbo-preview' | 'gpt-4-1106-preview' | 'gpt-4-vision-preview' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'; - /** - * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - */ - instructions?: string; - /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - */ - tools?: Array; - /** - * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. - * - */ - tool_resources?: { - code_interpreter?: { - /** - * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. - * - */ - file_ids?: Array; - }; - file_search?: { - /** - * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. - * - */ - vector_store_ids?: Array; - }; + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + */ + assistant_id: string; + thread?: CreateThreadRequest; + /** + * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + */ + model?: + | string + | 'gpt-5' + | 'gpt-5-mini' + | 'gpt-5-nano' + | 'gpt-5-2025-08-07' + | 'gpt-5-mini-2025-08-07' + | 'gpt-5-nano-2025-08-07' + | 'gpt-4.1' + | 'gpt-4.1-mini' + | 'gpt-4.1-nano' + | 'gpt-4.1-2025-04-14' + | 'gpt-4.1-mini-2025-04-14' + | 'gpt-4.1-nano-2025-04-14' + | 'gpt-4o' + | 'gpt-4o-2024-11-20' + | 'gpt-4o-2024-08-06' + | 'gpt-4o-2024-05-13' + | 'gpt-4o-mini' + | 'gpt-4o-mini-2024-07-18' + | 'gpt-4.5-preview' + | 'gpt-4.5-preview-2025-02-27' + | 'gpt-4-turbo' + | 'gpt-4-turbo-2024-04-09' + | 'gpt-4-0125-preview' + | 'gpt-4-turbo-preview' + | 'gpt-4-1106-preview' + | 'gpt-4-vision-preview' + | 'gpt-4' + | 'gpt-4-0314' + | 'gpt-4-0613' + | 'gpt-4-32k' + | 'gpt-4-32k-0314' + | 'gpt-4-32k-0613' + | 'gpt-3.5-turbo' + | 'gpt-3.5-turbo-16k' + | 'gpt-3.5-turbo-0613' + | 'gpt-3.5-turbo-1106' + | 'gpt-3.5-turbo-0125' + | 'gpt-3.5-turbo-16k-0613'; + /** + * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + */ + instructions?: string; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + /** + * A set of resources that are used by the assistant's tools. The resources are specific to the type of tool. For example, the `code_interpreter` tool requires a list of file IDs, while the `file_search` tool requires a list of vector store IDs. + * + */ + tool_resources?: { + code_interpreter?: { + /** + * A list of [file](https://platform.openai.com/docs/api-reference/files) IDs made available to the `code_interpreter` tool. There can be a maximum of 20 files associated with the tool. + * + */ + file_ids?: Array; }; - metadata?: Metadata; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * - */ - top_p?: number; - /** - * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_prompt_tokens?: number; - /** - * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_completion_tokens?: number; - truncation_strategy?: TruncationObject & unknown; - tool_choice?: AssistantsApiToolChoiceOption & unknown; - parallel_tool_calls?: ParallelToolCalls; - response_format?: AssistantsApiResponseFormatOption; + file_search?: { + /** + * The ID of the [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object) attached to this assistant. There can be a maximum of 1 vector store attached to the assistant. + * + */ + vector_store_ids?: Array; + }; + }; + metadata?: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + /** + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_prompt_tokens?: number; + /** + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_completion_tokens?: number; + truncation_strategy?: TruncationObject & unknown; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + parallel_tool_calls?: ParallelToolCalls; + response_format?: AssistantsApiResponseFormatOption; }; export type CreateRunRequestWithoutStream = { - /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - */ - assistant_id: string; - /** - * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. - */ - model?: string | AssistantSupportedModels; - reasoning_effort?: ReasoningEffort; - /** - * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. - */ - instructions?: string; - /** - * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. - */ - additional_instructions?: string; - /** - * Adds additional messages to the thread before creating the run. - */ - additional_messages?: Array; - /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - */ - tools?: Array; - metadata?: Metadata; - /** - * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. - * - */ - temperature?: number; - /** - * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. - * - * We generally recommend altering this or temperature but not both. - * - */ - top_p?: number; - /** - * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_prompt_tokens?: number; - /** - * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. - * - */ - max_completion_tokens?: number; - truncation_strategy?: TruncationObject & unknown; - tool_choice?: AssistantsApiToolChoiceOption & unknown; - parallel_tool_calls?: ParallelToolCalls; - response_format?: AssistantsApiResponseFormatOption; + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + */ + assistant_id: string; + /** + * The ID of the [Model](https://platform.openai.com/docs/api-reference/models) to be used to execute this run. If a value is provided here, it will override the model associated with the assistant. If not, the model associated with the assistant will be used. + */ + model?: string | AssistantSupportedModels; + reasoning_effort?: ReasoningEffort; + /** + * Overrides the [instructions](https://platform.openai.com/docs/api-reference/assistants/createAssistant) of the assistant. This is useful for modifying the behavior on a per-run basis. + */ + instructions?: string; + /** + * Appends additional instructions at the end of the instructions for the run. This is useful for modifying the behavior on a per-run basis without overriding other instructions. + */ + additional_instructions?: string; + /** + * Adds additional messages to the thread before creating the run. + */ + additional_messages?: Array; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + metadata?: Metadata; + /** + * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic. + * + */ + temperature?: number; + /** + * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. + * + * We generally recommend altering this or temperature but not both. + * + */ + top_p?: number; + /** + * The maximum number of prompt tokens that may be used over the course of the run. The run will make a best effort to use only the number of prompt tokens specified, across multiple turns of the run. If the run exceeds the number of prompt tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_prompt_tokens?: number; + /** + * The maximum number of completion tokens that may be used over the course of the run. The run will make a best effort to use only the number of completion tokens specified, across multiple turns of the run. If the run exceeds the number of completion tokens specified, the run will end with status `incomplete`. See `incomplete_details` for more info. + * + */ + max_completion_tokens?: number; + truncation_strategy?: TruncationObject & unknown; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + parallel_tool_calls?: ParallelToolCalls; + response_format?: AssistantsApiResponseFormatOption; }; export type SubmitToolOutputsRunRequestWithoutStream = { + /** + * A list of tools for which the outputs are being submitted. + */ + tool_outputs: Array<{ /** - * A list of tools for which the outputs are being submitted. + * The ID of the tool call in the `required_action` object within the run object the output is being submitted for. */ - tool_outputs: Array<{ - /** - * The ID of the tool call in the `required_action` object within the run object the output is being submitted for. - */ - tool_call_id?: string; - /** - * The output of the tool call to be submitted to continue the run. - */ - output?: string; - }>; + tool_call_id?: string; + /** + * The output of the tool call to be submitted to continue the run. + */ + output?: string; + }>; }; /** * The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. */ export const RunStatus = { - QUEUED: 'queued', - IN_PROGRESS: 'in_progress', - REQUIRES_ACTION: 'requires_action', - CANCELLING: 'cancelling', - CANCELLED: 'cancelled', - FAILED: 'failed', - COMPLETED: 'completed', - INCOMPLETE: 'incomplete', - EXPIRED: 'expired' + QUEUED: 'queued', + IN_PROGRESS: 'in_progress', + REQUIRES_ACTION: 'requires_action', + CANCELLING: 'cancelling', + CANCELLED: 'cancelled', + FAILED: 'failed', + COMPLETED: 'completed', + INCOMPLETE: 'incomplete', + EXPIRED: 'expired', } as const; /** * The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. */ -export type RunStatus = typeof RunStatus[keyof typeof RunStatus]; +export type RunStatus = (typeof RunStatus)[keyof typeof RunStatus]; /** * The delta containing the fields that have changed on the run step. */ export type RunStepDeltaObjectDelta = { - /** - * The details of the run step. - */ - step_details?: ({ + /** + * The details of the run step. + */ + step_details?: + | ({ type?: 'RunStepDeltaStepDetailsMessageCreationObject'; - } & RunStepDeltaStepDetailsMessageCreationObject) | ({ + } & RunStepDeltaStepDetailsMessageCreationObject) + | ({ type?: 'RunStepDeltaStepDetailsToolCallsObject'; - } & RunStepDeltaStepDetailsToolCallsObject); + } & RunStepDeltaStepDetailsToolCallsObject); }; export type ListAssistantsData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - }; - url: '/assistants'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + }; + url: '/assistants'; }; export type ListAssistantsResponses = { - /** - * OK - */ - 200: ListAssistantsResponse; + /** + * OK + */ + 200: ListAssistantsResponse; }; export type ListAssistantsResponse2 = ListAssistantsResponses[keyof ListAssistantsResponses]; export type CreateAssistantData = { - body: CreateAssistantRequest; - path?: never; - query?: never; - url: '/assistants'; + body: CreateAssistantRequest; + path?: never; + query?: never; + url: '/assistants'; }; export type CreateAssistantResponses = { - /** - * OK - */ - 200: AssistantObject; + /** + * OK + */ + 200: AssistantObject; }; export type CreateAssistantResponse = CreateAssistantResponses[keyof CreateAssistantResponses]; export type DeleteAssistantData = { - body?: never; - path: { - /** - * The ID of the assistant to delete. - */ - assistant_id: string; - }; - query?: never; - url: '/assistants/{assistant_id}'; + body?: never; + path: { + /** + * The ID of the assistant to delete. + */ + assistant_id: string; + }; + query?: never; + url: '/assistants/{assistant_id}'; }; export type DeleteAssistantResponses = { - /** - * OK - */ - 200: DeleteAssistantResponse; + /** + * OK + */ + 200: DeleteAssistantResponse; }; export type DeleteAssistantResponse2 = DeleteAssistantResponses[keyof DeleteAssistantResponses]; export type GetAssistantData = { - body?: never; - path: { - /** - * The ID of the assistant to retrieve. - */ - assistant_id: string; - }; - query?: never; - url: '/assistants/{assistant_id}'; + body?: never; + path: { + /** + * The ID of the assistant to retrieve. + */ + assistant_id: string; + }; + query?: never; + url: '/assistants/{assistant_id}'; }; export type GetAssistantResponses = { - /** - * OK - */ - 200: AssistantObject; + /** + * OK + */ + 200: AssistantObject; }; export type GetAssistantResponse = GetAssistantResponses[keyof GetAssistantResponses]; export type ModifyAssistantData = { - body: ModifyAssistantRequest; - path: { - /** - * The ID of the assistant to modify. - */ - assistant_id: string; - }; - query?: never; - url: '/assistants/{assistant_id}'; + body: ModifyAssistantRequest; + path: { + /** + * The ID of the assistant to modify. + */ + assistant_id: string; + }; + query?: never; + url: '/assistants/{assistant_id}'; }; export type ModifyAssistantResponses = { - /** - * OK - */ - 200: AssistantObject; + /** + * OK + */ + 200: AssistantObject; }; export type ModifyAssistantResponse = ModifyAssistantResponses[keyof ModifyAssistantResponses]; export type CreateSpeechData = { - body: CreateSpeechRequest; - path?: never; - query?: never; - url: '/audio/speech'; + body: CreateSpeechRequest; + path?: never; + query?: never; + url: '/audio/speech'; }; export type CreateSpeechResponses = { - /** - * OK - */ - 200: Blob | File; + /** + * OK + */ + 200: Blob | File; }; export type CreateSpeechResponse = CreateSpeechResponses[keyof CreateSpeechResponses]; export type CreateTranscriptionData = { - body: CreateTranscriptionRequest; - path?: never; - query?: never; - url: '/audio/transcriptions'; + body: CreateTranscriptionRequest; + path?: never; + query?: never; + url: '/audio/transcriptions'; }; export type CreateTranscriptionResponses = { - /** - * OK - */ - 200: CreateTranscriptionResponseJson | CreateTranscriptionResponseVerboseJson; + /** + * OK + */ + 200: CreateTranscriptionResponseJson | CreateTranscriptionResponseVerboseJson; }; -export type CreateTranscriptionResponse = CreateTranscriptionResponses[keyof CreateTranscriptionResponses]; +export type CreateTranscriptionResponse = + CreateTranscriptionResponses[keyof CreateTranscriptionResponses]; export type CreateTranslationData = { - body: CreateTranslationRequest; - path?: never; - query?: never; - url: '/audio/translations'; + body: CreateTranslationRequest; + path?: never; + query?: never; + url: '/audio/translations'; }; export type CreateTranslationResponses = { - /** - * OK - */ - 200: CreateTranslationResponseJson | CreateTranslationResponseVerboseJson; + /** + * OK + */ + 200: CreateTranslationResponseJson | CreateTranslationResponseVerboseJson; }; -export type CreateTranslationResponse = CreateTranslationResponses[keyof CreateTranslationResponses]; +export type CreateTranslationResponse = + CreateTranslationResponses[keyof CreateTranslationResponses]; export type ListBatchesData = { - body?: never; - path?: never; - query?: { - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - }; - url: '/batches'; + body?: never; + path?: never; + query?: { + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + }; + url: '/batches'; }; export type ListBatchesResponses = { - /** - * Batch listed successfully. - */ - 200: ListBatchesResponse; + /** + * Batch listed successfully. + */ + 200: ListBatchesResponse; }; export type ListBatchesResponse2 = ListBatchesResponses[keyof ListBatchesResponses]; export type CreateBatchData = { - body: { - /** - * The ID of an uploaded file that contains requests for the new batch. - * - * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. - * - * Your input file must be formatted as a [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 200 MB in size. - * - */ - input_file_id: string; - /** - * The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` 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' | '/v1/chat/completions' | '/v1/embeddings' | '/v1/completions'; - /** - * The time frame within which the batch should be processed. Currently only `24h` is supported. - */ - completion_window: '24h'; - metadata?: Metadata; - output_expires_after?: BatchFileExpirationAfter; - }; - path?: never; - query?: never; - url: '/batches'; + body: { + /** + * The ID of an uploaded file that contains requests for the new batch. + * + * See [upload file](https://platform.openai.com/docs/api-reference/files/create) for how to upload a file. + * + * Your input file must be formatted as a [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, and can be up to 200 MB in size. + * + */ + input_file_id: string; + /** + * The endpoint to be used for all requests in the batch. Currently `/v1/responses`, `/v1/chat/completions`, `/v1/embeddings`, and `/v1/completions` 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' | '/v1/chat/completions' | '/v1/embeddings' | '/v1/completions'; + /** + * The time frame within which the batch should be processed. Currently only `24h` is supported. + */ + completion_window: '24h'; + metadata?: Metadata; + output_expires_after?: BatchFileExpirationAfter; + }; + path?: never; + query?: never; + url: '/batches'; }; export type CreateBatchResponses = { - /** - * Batch created successfully. - */ - 200: Batch; + /** + * Batch created successfully. + */ + 200: Batch; }; export type CreateBatchResponse = CreateBatchResponses[keyof CreateBatchResponses]; export type RetrieveBatchData = { - body?: never; - path: { - /** - * The ID of the batch to retrieve. - */ - batch_id: string; - }; - query?: never; - url: '/batches/{batch_id}'; + body?: never; + path: { + /** + * The ID of the batch to retrieve. + */ + batch_id: string; + }; + query?: never; + url: '/batches/{batch_id}'; }; export type RetrieveBatchResponses = { - /** - * Batch retrieved successfully. - */ - 200: Batch; + /** + * Batch retrieved successfully. + */ + 200: Batch; }; export type RetrieveBatchResponse = RetrieveBatchResponses[keyof RetrieveBatchResponses]; export type CancelBatchData = { - body?: never; - path: { - /** - * The ID of the batch to cancel. - */ - batch_id: string; - }; - query?: never; - url: '/batches/{batch_id}/cancel'; + body?: never; + path: { + /** + * The ID of the batch to cancel. + */ + batch_id: string; + }; + query?: never; + url: '/batches/{batch_id}/cancel'; }; export type CancelBatchResponses = { - /** - * Batch is cancelling. Returns the cancelling batch's details. - */ - 200: Batch; + /** + * Batch is cancelling. Returns the cancelling batch's details. + */ + 200: Batch; }; export type CancelBatchResponse = CancelBatchResponses[keyof CancelBatchResponses]; export type ListChatCompletionsData = { - body?: never; - path?: never; - query?: { - /** - * The model used to generate the Chat Completions. - */ - model?: string; - /** - * A list of metadata keys to filter the Chat Completions by. Example: - * - * `metadata[key1]=value1&metadata[key2]=value2` - * - */ - metadata?: Metadata; - /** - * Identifier for the last chat completion from the previous pagination request. - */ - after?: string; - /** - * Number of Chat Completions to retrieve. - */ - limit?: number; - /** - * Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. - */ - order?: 'asc' | 'desc'; - }; - url: '/chat/completions'; + body?: never; + path?: never; + query?: { + /** + * The model used to generate the Chat Completions. + */ + model?: string; + /** + * A list of metadata keys to filter the Chat Completions by. Example: + * + * `metadata[key1]=value1&metadata[key2]=value2` + * + */ + metadata?: Metadata; + /** + * Identifier for the last chat completion from the previous pagination request. + */ + after?: string; + /** + * Number of Chat Completions to retrieve. + */ + limit?: number; + /** + * Sort order for Chat Completions by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. + */ + order?: 'asc' | 'desc'; + }; + url: '/chat/completions'; }; export type ListChatCompletionsResponses = { - /** - * A list of Chat Completions - */ - 200: ChatCompletionList; + /** + * A list of Chat Completions + */ + 200: ChatCompletionList; }; -export type ListChatCompletionsResponse = ListChatCompletionsResponses[keyof ListChatCompletionsResponses]; +export type ListChatCompletionsResponse = + ListChatCompletionsResponses[keyof ListChatCompletionsResponses]; export type CreateChatCompletionData = { - body: CreateChatCompletionRequest; - path?: never; - query?: never; - url: '/chat/completions'; + body: CreateChatCompletionRequest; + path?: never; + query?: never; + url: '/chat/completions'; }; export type CreateChatCompletionResponses = { - /** - * OK - */ - 200: CreateChatCompletionResponse; + /** + * OK + */ + 200: CreateChatCompletionResponse; }; -export type CreateChatCompletionResponse2 = CreateChatCompletionResponses[keyof CreateChatCompletionResponses]; +export type CreateChatCompletionResponse2 = + CreateChatCompletionResponses[keyof CreateChatCompletionResponses]; export type DeleteChatCompletionData = { - body?: never; - path: { - /** - * The ID of the chat completion to delete. - */ - completion_id: string; - }; - query?: never; - url: '/chat/completions/{completion_id}'; + body?: never; + path: { + /** + * The ID of the chat completion to delete. + */ + completion_id: string; + }; + query?: never; + url: '/chat/completions/{completion_id}'; }; export type DeleteChatCompletionResponses = { - /** - * The chat completion was deleted successfully. - */ - 200: ChatCompletionDeleted; + /** + * The chat completion was deleted successfully. + */ + 200: ChatCompletionDeleted; }; -export type DeleteChatCompletionResponse = DeleteChatCompletionResponses[keyof DeleteChatCompletionResponses]; +export type DeleteChatCompletionResponse = + DeleteChatCompletionResponses[keyof DeleteChatCompletionResponses]; export type GetChatCompletionData = { - body?: never; - path: { - /** - * The ID of the chat completion to retrieve. - */ - completion_id: string; - }; - query?: never; - url: '/chat/completions/{completion_id}'; + body?: never; + path: { + /** + * The ID of the chat completion to retrieve. + */ + completion_id: string; + }; + query?: never; + url: '/chat/completions/{completion_id}'; }; export type GetChatCompletionResponses = { - /** - * A chat completion - */ - 200: CreateChatCompletionResponse; + /** + * A chat completion + */ + 200: CreateChatCompletionResponse; }; -export type GetChatCompletionResponse = GetChatCompletionResponses[keyof GetChatCompletionResponses]; +export type GetChatCompletionResponse = + GetChatCompletionResponses[keyof GetChatCompletionResponses]; export type UpdateChatCompletionData = { - body: { - metadata: Metadata; - }; - path: { - /** - * The ID of the chat completion to update. - */ - completion_id: string; - }; - query?: never; - url: '/chat/completions/{completion_id}'; + body: { + metadata: Metadata; + }; + path: { + /** + * The ID of the chat completion to update. + */ + completion_id: string; + }; + query?: never; + url: '/chat/completions/{completion_id}'; }; export type UpdateChatCompletionResponses = { - /** - * A chat completion - */ - 200: CreateChatCompletionResponse; + /** + * A chat completion + */ + 200: CreateChatCompletionResponse; }; -export type UpdateChatCompletionResponse = UpdateChatCompletionResponses[keyof UpdateChatCompletionResponses]; +export type UpdateChatCompletionResponse = + UpdateChatCompletionResponses[keyof UpdateChatCompletionResponses]; export type GetChatCompletionMessagesData = { - body?: never; - path: { - /** - * The ID of the chat completion to retrieve messages from. - */ - completion_id: string; - }; - query?: { - /** - * Identifier for the last message from the previous pagination request. - */ - after?: string; - /** - * Number of messages to retrieve. - */ - limit?: number; - /** - * Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. - */ - order?: 'asc' | 'desc'; - }; - url: '/chat/completions/{completion_id}/messages'; + body?: never; + path: { + /** + * The ID of the chat completion to retrieve messages from. + */ + completion_id: string; + }; + query?: { + /** + * Identifier for the last message from the previous pagination request. + */ + after?: string; + /** + * Number of messages to retrieve. + */ + limit?: number; + /** + * Sort order for messages by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. + */ + order?: 'asc' | 'desc'; + }; + url: '/chat/completions/{completion_id}/messages'; }; export type GetChatCompletionMessagesResponses = { - /** - * A list of messages - */ - 200: ChatCompletionMessageList; + /** + * A list of messages + */ + 200: ChatCompletionMessageList; }; -export type GetChatCompletionMessagesResponse = GetChatCompletionMessagesResponses[keyof GetChatCompletionMessagesResponses]; +export type GetChatCompletionMessagesResponse = + GetChatCompletionMessagesResponses[keyof GetChatCompletionMessagesResponses]; export type CreateCompletionData = { - body: CreateCompletionRequest; - path?: never; - query?: never; - url: '/completions'; + body: CreateCompletionRequest; + path?: never; + query?: never; + url: '/completions'; }; export type CreateCompletionResponses = { - /** - * OK - */ - 200: CreateCompletionResponse; + /** + * OK + */ + 200: CreateCompletionResponse; }; export type CreateCompletionResponse2 = CreateCompletionResponses[keyof CreateCompletionResponses]; export type ListContainersData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/containers'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/containers'; }; export type ListContainersResponses = { - /** - * Success - */ - 200: ContainerListResource; + /** + * Success + */ + 200: ContainerListResource; }; export type ListContainersResponse = ListContainersResponses[keyof ListContainersResponses]; export type CreateContainerData = { - body?: CreateContainerBody; - path?: never; - query?: never; - url: '/containers'; + body?: CreateContainerBody; + path?: never; + query?: never; + url: '/containers'; }; export type CreateContainerResponses = { - /** - * Success - */ - 200: ContainerResource; + /** + * Success + */ + 200: ContainerResource; }; export type CreateContainerResponse = CreateContainerResponses[keyof CreateContainerResponses]; export type DeleteContainerData = { - body?: never; - path: { - /** - * The ID of the container to delete. - */ - container_id: string; - }; - query?: never; - url: '/containers/{container_id}'; + body?: never; + path: { + /** + * The ID of the container to delete. + */ + container_id: string; + }; + query?: never; + url: '/containers/{container_id}'; }; export type DeleteContainerResponses = { - /** - * OK - */ - 200: unknown; + /** + * OK + */ + 200: unknown; }; export type RetrieveContainerData = { - body?: never; - path: { - container_id: string; - }; - query?: never; - url: '/containers/{container_id}'; + body?: never; + path: { + container_id: string; + }; + query?: never; + url: '/containers/{container_id}'; }; export type RetrieveContainerResponses = { - /** - * Success - */ - 200: ContainerResource; + /** + * Success + */ + 200: ContainerResource; }; -export type RetrieveContainerResponse = RetrieveContainerResponses[keyof RetrieveContainerResponses]; +export type RetrieveContainerResponse = + RetrieveContainerResponses[keyof RetrieveContainerResponses]; export type ListContainerFilesData = { - body?: never; - path: { - container_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/containers/{container_id}/files'; + body?: never; + path: { + container_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/containers/{container_id}/files'; }; export type ListContainerFilesResponses = { - /** - * Success - */ - 200: ContainerFileListResource; + /** + * Success + */ + 200: ContainerFileListResource; }; -export type ListContainerFilesResponse = ListContainerFilesResponses[keyof ListContainerFilesResponses]; +export type ListContainerFilesResponse = + ListContainerFilesResponses[keyof ListContainerFilesResponses]; export type CreateContainerFileData = { - body: CreateContainerFileBody; - path: { - container_id: string; - }; - query?: never; - url: '/containers/{container_id}/files'; + body: CreateContainerFileBody; + path: { + container_id: string; + }; + query?: never; + url: '/containers/{container_id}/files'; }; export type CreateContainerFileResponses = { - /** - * Success - */ - 200: ContainerFileResource; + /** + * Success + */ + 200: ContainerFileResource; }; -export type CreateContainerFileResponse = CreateContainerFileResponses[keyof CreateContainerFileResponses]; +export type CreateContainerFileResponse = + CreateContainerFileResponses[keyof CreateContainerFileResponses]; export type DeleteContainerFileData = { - body?: never; - path: { - container_id: string; - file_id: string; - }; - query?: never; - url: '/containers/{container_id}/files/{file_id}'; + body?: never; + path: { + container_id: string; + file_id: string; + }; + query?: never; + url: '/containers/{container_id}/files/{file_id}'; }; export type DeleteContainerFileResponses = { - /** - * OK - */ - 200: unknown; + /** + * OK + */ + 200: unknown; }; export type RetrieveContainerFileData = { - body?: never; - path: { - container_id: string; - file_id: string; - }; - query?: never; - url: '/containers/{container_id}/files/{file_id}'; + body?: never; + path: { + container_id: string; + file_id: string; + }; + query?: never; + url: '/containers/{container_id}/files/{file_id}'; }; export type RetrieveContainerFileResponses = { - /** - * Success - */ - 200: ContainerFileResource; + /** + * Success + */ + 200: ContainerFileResource; }; -export type RetrieveContainerFileResponse = RetrieveContainerFileResponses[keyof RetrieveContainerFileResponses]; +export type RetrieveContainerFileResponse = + RetrieveContainerFileResponses[keyof RetrieveContainerFileResponses]; export type RetrieveContainerFileContentData = { - body?: never; - path: { - container_id: string; - file_id: string; - }; - query?: never; - url: '/containers/{container_id}/files/{file_id}/content'; + body?: never; + path: { + container_id: string; + file_id: string; + }; + query?: never; + url: '/containers/{container_id}/files/{file_id}/content'; }; export type RetrieveContainerFileContentResponses = { - /** - * Success - */ - 200: unknown; + /** + * Success + */ + 200: unknown; }; export type CreateEmbeddingData = { - body: CreateEmbeddingRequest; - path?: never; - query?: never; - url: '/embeddings'; + body: CreateEmbeddingRequest; + path?: never; + query?: never; + url: '/embeddings'; }; export type CreateEmbeddingResponses = { - /** - * OK - */ - 200: CreateEmbeddingResponse; + /** + * OK + */ + 200: CreateEmbeddingResponse; }; export type CreateEmbeddingResponse2 = CreateEmbeddingResponses[keyof CreateEmbeddingResponses]; export type ListEvalsData = { - body?: never; - path?: never; - query?: { - /** - * Identifier for the last eval from the previous pagination request. - */ - after?: string; - /** - * Number of evals to retrieve. - */ - limit?: number; - /** - * Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for descending order. - */ - order?: 'asc' | 'desc'; - /** - * Evals can be ordered by creation time or last updated time. Use - * `created_at` for creation time or `updated_at` for last updated time. - * - */ - order_by?: 'created_at' | 'updated_at'; - }; - url: '/evals'; + body?: never; + path?: never; + query?: { + /** + * Identifier for the last eval from the previous pagination request. + */ + after?: string; + /** + * Number of evals to retrieve. + */ + limit?: number; + /** + * Sort order for evals by timestamp. Use `asc` for ascending order or `desc` for descending order. + */ + order?: 'asc' | 'desc'; + /** + * Evals can be ordered by creation time or last updated time. Use + * `created_at` for creation time or `updated_at` for last updated time. + * + */ + order_by?: 'created_at' | 'updated_at'; + }; + url: '/evals'; }; export type ListEvalsResponses = { - /** - * A list of evals - */ - 200: EvalList; + /** + * A list of evals + */ + 200: EvalList; }; export type ListEvalsResponse = ListEvalsResponses[keyof ListEvalsResponses]; export type CreateEvalData = { - body: CreateEvalRequest; - path?: never; - query?: never; - url: '/evals'; + body: CreateEvalRequest; + path?: never; + query?: never; + url: '/evals'; }; export type CreateEvalResponses = { - /** - * OK - */ - 201: Eval; + /** + * OK + */ + 201: Eval; }; export type CreateEvalResponse = CreateEvalResponses[keyof CreateEvalResponses]; export type DeleteEvalData = { - body?: never; - path: { - /** - * The ID of the evaluation to delete. - */ - eval_id: string; - }; - query?: never; - url: '/evals/{eval_id}'; + body?: never; + path: { + /** + * The ID of the evaluation to delete. + */ + eval_id: string; + }; + query?: never; + url: '/evals/{eval_id}'; }; export type DeleteEvalErrors = { - /** - * Evaluation not found. - */ - 404: Error; + /** + * Evaluation not found. + */ + 404: Error; }; export type DeleteEvalError = DeleteEvalErrors[keyof DeleteEvalErrors]; export type DeleteEvalResponses = { - /** - * Successfully deleted the evaluation. - */ - 200: { - object: string; - deleted: boolean; - eval_id: string; - }; + /** + * Successfully deleted the evaluation. + */ + 200: { + object: string; + deleted: boolean; + eval_id: string; + }; }; export type DeleteEvalResponse = DeleteEvalResponses[keyof DeleteEvalResponses]; export type GetEvalData = { - body?: never; - path: { - /** - * The ID of the evaluation to retrieve. - */ - eval_id: string; - }; - query?: never; - url: '/evals/{eval_id}'; + body?: never; + path: { + /** + * The ID of the evaluation to retrieve. + */ + eval_id: string; + }; + query?: never; + url: '/evals/{eval_id}'; }; export type GetEvalResponses = { - /** - * The evaluation - */ - 200: Eval; + /** + * The evaluation + */ + 200: Eval; }; export type GetEvalResponse = GetEvalResponses[keyof GetEvalResponses]; export type UpdateEvalData = { + /** + * Request to update an evaluation + */ + body: { /** - * Request to update an evaluation + * Rename the evaluation. */ - body: { - /** - * Rename the evaluation. - */ - name?: string; - metadata?: Metadata; - }; - path: { - /** - * The ID of the evaluation to update. - */ - eval_id: string; - }; - query?: never; - url: '/evals/{eval_id}'; + name?: string; + metadata?: Metadata; + }; + path: { + /** + * The ID of the evaluation to update. + */ + eval_id: string; + }; + query?: never; + url: '/evals/{eval_id}'; }; export type UpdateEvalResponses = { - /** - * The updated evaluation - */ - 200: Eval; + /** + * The updated evaluation + */ + 200: Eval; }; export type UpdateEvalResponse = UpdateEvalResponses[keyof UpdateEvalResponses]; export type GetEvalRunsData = { - body?: never; - path: { - /** - * The ID of the evaluation to retrieve runs for. - */ - eval_id: string; - }; - query?: { - /** - * Identifier for the last run from the previous pagination request. - */ - after?: string; - /** - * Number of runs to retrieve. - */ - limit?: number; - /** - * Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. - */ - order?: 'asc' | 'desc'; - /** - * Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`. - */ - status?: 'queued' | 'in_progress' | 'completed' | 'canceled' | 'failed'; - }; - url: '/evals/{eval_id}/runs'; + body?: never; + path: { + /** + * The ID of the evaluation to retrieve runs for. + */ + eval_id: string; + }; + query?: { + /** + * Identifier for the last run from the previous pagination request. + */ + after?: string; + /** + * Number of runs to retrieve. + */ + limit?: number; + /** + * Sort order for runs by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. + */ + order?: 'asc' | 'desc'; + /** + * Filter runs by status. One of `queued` | `in_progress` | `failed` | `completed` | `canceled`. + */ + status?: 'queued' | 'in_progress' | 'completed' | 'canceled' | 'failed'; + }; + url: '/evals/{eval_id}/runs'; }; export type GetEvalRunsResponses = { - /** - * A list of runs for the evaluation - */ - 200: EvalRunList; + /** + * A list of runs for the evaluation + */ + 200: EvalRunList; }; export type GetEvalRunsResponse = GetEvalRunsResponses[keyof GetEvalRunsResponses]; export type CreateEvalRunData = { - body: CreateEvalRunRequest; - path: { - /** - * The ID of the evaluation to create a run for. - */ - eval_id: string; - }; - query?: never; - url: '/evals/{eval_id}/runs'; + body: CreateEvalRunRequest; + path: { + /** + * The ID of the evaluation to create a run for. + */ + eval_id: string; + }; + query?: never; + url: '/evals/{eval_id}/runs'; }; export type CreateEvalRunErrors = { - /** - * Bad request (for example, missing eval object) - */ - 400: Error; + /** + * Bad request (for example, missing eval object) + */ + 400: Error; }; export type CreateEvalRunError = CreateEvalRunErrors[keyof CreateEvalRunErrors]; export type CreateEvalRunResponses = { - /** - * Successfully created a run for the evaluation - */ - 201: EvalRun; + /** + * Successfully created a run for the evaluation + */ + 201: EvalRun; }; export type CreateEvalRunResponse = CreateEvalRunResponses[keyof CreateEvalRunResponses]; export type DeleteEvalRunData = { - body?: never; - path: { - /** - * The ID of the evaluation to delete the run from. - */ - eval_id: string; - /** - * The ID of the run to delete. - */ - run_id: string; - }; - query?: never; - url: '/evals/{eval_id}/runs/{run_id}'; + body?: never; + path: { + /** + * The ID of the evaluation to delete the run from. + */ + eval_id: string; + /** + * The ID of the run to delete. + */ + run_id: string; + }; + query?: never; + url: '/evals/{eval_id}/runs/{run_id}'; }; export type DeleteEvalRunErrors = { - /** - * Run not found - */ - 404: Error; + /** + * Run not found + */ + 404: Error; }; export type DeleteEvalRunError = DeleteEvalRunErrors[keyof DeleteEvalRunErrors]; export type DeleteEvalRunResponses = { - /** - * Successfully deleted the eval run - */ - 200: { - object?: string; - deleted?: boolean; - run_id?: string; - }; + /** + * Successfully deleted the eval run + */ + 200: { + object?: string; + deleted?: boolean; + run_id?: string; + }; }; export type DeleteEvalRunResponse = DeleteEvalRunResponses[keyof DeleteEvalRunResponses]; export type GetEvalRunData = { - body?: never; - path: { - /** - * The ID of the evaluation to retrieve runs for. - */ - eval_id: string; - /** - * The ID of the run to retrieve. - */ - run_id: string; - }; - query?: never; - url: '/evals/{eval_id}/runs/{run_id}'; + body?: never; + path: { + /** + * The ID of the evaluation to retrieve runs for. + */ + eval_id: string; + /** + * The ID of the run to retrieve. + */ + run_id: string; + }; + query?: never; + url: '/evals/{eval_id}/runs/{run_id}'; }; export type GetEvalRunResponses = { - /** - * The evaluation run - */ - 200: EvalRun; + /** + * The evaluation run + */ + 200: EvalRun; }; export type GetEvalRunResponse = GetEvalRunResponses[keyof GetEvalRunResponses]; export type CancelEvalRunData = { - body?: never; - path: { - /** - * The ID of the evaluation whose run you want to cancel. - */ - eval_id: string; - /** - * The ID of the run to cancel. - */ - run_id: string; - }; - query?: never; - url: '/evals/{eval_id}/runs/{run_id}'; + body?: never; + path: { + /** + * The ID of the evaluation whose run you want to cancel. + */ + eval_id: string; + /** + * The ID of the run to cancel. + */ + run_id: string; + }; + query?: never; + url: '/evals/{eval_id}/runs/{run_id}'; }; export type CancelEvalRunResponses = { - /** - * The canceled eval run object - */ - 200: EvalRun; + /** + * The canceled eval run object + */ + 200: EvalRun; }; export type CancelEvalRunResponse = CancelEvalRunResponses[keyof CancelEvalRunResponses]; export type GetEvalRunOutputItemsData = { - body?: never; - path: { - /** - * The ID of the evaluation to retrieve runs for. - */ - eval_id: string; - /** - * The ID of the run to retrieve output items for. - */ - run_id: string; - }; - query?: { - /** - * Identifier for the last output item from the previous pagination request. - */ - after?: string; - /** - * Number of output items to retrieve. - */ - limit?: number; - /** - * Filter output items by status. Use `failed` to filter by failed output - * items or `pass` to filter by passed output items. - * - */ - status?: 'fail' | 'pass'; - /** - * Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. - */ - order?: 'asc' | 'desc'; - }; - url: '/evals/{eval_id}/runs/{run_id}/output_items'; + body?: never; + path: { + /** + * The ID of the evaluation to retrieve runs for. + */ + eval_id: string; + /** + * The ID of the run to retrieve output items for. + */ + run_id: string; + }; + query?: { + /** + * Identifier for the last output item from the previous pagination request. + */ + after?: string; + /** + * Number of output items to retrieve. + */ + limit?: number; + /** + * Filter output items by status. Use `failed` to filter by failed output + * items or `pass` to filter by passed output items. + * + */ + status?: 'fail' | 'pass'; + /** + * Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. + */ + order?: 'asc' | 'desc'; + }; + url: '/evals/{eval_id}/runs/{run_id}/output_items'; }; export type GetEvalRunOutputItemsResponses = { - /** - * A list of output items for the evaluation run - */ - 200: EvalRunOutputItemList; + /** + * A list of output items for the evaluation run + */ + 200: EvalRunOutputItemList; }; -export type GetEvalRunOutputItemsResponse = GetEvalRunOutputItemsResponses[keyof GetEvalRunOutputItemsResponses]; +export type GetEvalRunOutputItemsResponse = + GetEvalRunOutputItemsResponses[keyof GetEvalRunOutputItemsResponses]; export type GetEvalRunOutputItemData = { - body?: never; - path: { - /** - * The ID of the evaluation to retrieve runs for. - */ - eval_id: string; - /** - * The ID of the run to retrieve. - */ - run_id: string; - /** - * The ID of the output item to retrieve. - */ - output_item_id: string; - }; - query?: never; - url: '/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}'; + body?: never; + path: { + /** + * The ID of the evaluation to retrieve runs for. + */ + eval_id: string; + /** + * The ID of the run to retrieve. + */ + run_id: string; + /** + * The ID of the output item to retrieve. + */ + output_item_id: string; + }; + query?: never; + url: '/evals/{eval_id}/runs/{run_id}/output_items/{output_item_id}'; }; export type GetEvalRunOutputItemResponses = { - /** - * The evaluation run output item - */ - 200: EvalRunOutputItem; + /** + * The evaluation run output item + */ + 200: EvalRunOutputItem; }; -export type GetEvalRunOutputItemResponse = GetEvalRunOutputItemResponses[keyof GetEvalRunOutputItemResponses]; +export type GetEvalRunOutputItemResponse = + GetEvalRunOutputItemResponses[keyof GetEvalRunOutputItemResponses]; export type ListFilesData = { - body?: never; - path?: never; - query?: { - /** - * Only return files with the given purpose. - */ - purpose?: string; - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/files'; + body?: never; + path?: never; + query?: { + /** + * Only return files with the given purpose. + */ + purpose?: string; + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 10,000, and the default is 10,000. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/files'; }; export type ListFilesResponses = { - /** - * OK - */ - 200: ListFilesResponse; + /** + * OK + */ + 200: ListFilesResponse; }; export type ListFilesResponse2 = ListFilesResponses[keyof ListFilesResponses]; export type CreateFileData = { - body: CreateFileRequest; - path?: never; - query?: never; - url: '/files'; + body: CreateFileRequest; + path?: never; + query?: never; + url: '/files'; }; export type CreateFileResponses = { - /** - * OK - */ - 200: OpenAiFile; + /** + * OK + */ + 200: OpenAiFile; }; export type CreateFileResponse = CreateFileResponses[keyof CreateFileResponses]; export type DeleteFileData = { - body?: never; - path: { - /** - * The ID of the file to use for this request. - */ - file_id: string; - }; - query?: never; - url: '/files/{file_id}'; + body?: never; + path: { + /** + * The ID of the file to use for this request. + */ + file_id: string; + }; + query?: never; + url: '/files/{file_id}'; }; export type DeleteFileResponses = { - /** - * OK - */ - 200: DeleteFileResponse; + /** + * OK + */ + 200: DeleteFileResponse; }; export type DeleteFileResponse2 = DeleteFileResponses[keyof DeleteFileResponses]; export type RetrieveFileData = { - body?: never; - path: { - /** - * The ID of the file to use for this request. - */ - file_id: string; - }; - query?: never; - url: '/files/{file_id}'; + body?: never; + path: { + /** + * The ID of the file to use for this request. + */ + file_id: string; + }; + query?: never; + url: '/files/{file_id}'; }; export type RetrieveFileResponses = { - /** - * OK - */ - 200: OpenAiFile; + /** + * OK + */ + 200: OpenAiFile; }; export type RetrieveFileResponse = RetrieveFileResponses[keyof RetrieveFileResponses]; export type DownloadFileData = { - body?: never; - path: { - /** - * The ID of the file to use for this request. - */ - file_id: string; - }; - query?: never; - url: '/files/{file_id}/content'; + body?: never; + path: { + /** + * The ID of the file to use for this request. + */ + file_id: string; + }; + query?: never; + url: '/files/{file_id}/content'; }; export type DownloadFileResponses = { - /** - * OK - */ - 200: string; + /** + * OK + */ + 200: string; }; export type DownloadFileResponse = DownloadFileResponses[keyof DownloadFileResponses]; export type RunGraderData = { - body: RunGraderRequest; - path?: never; - query?: never; - url: '/fine_tuning/alpha/graders/run'; + body: RunGraderRequest; + path?: never; + query?: never; + url: '/fine_tuning/alpha/graders/run'; }; export type RunGraderResponses = { - /** - * OK - */ - 200: RunGraderResponse; + /** + * OK + */ + 200: RunGraderResponse; }; export type RunGraderResponse2 = RunGraderResponses[keyof RunGraderResponses]; export type ValidateGraderData = { - body: ValidateGraderRequest; - path?: never; - query?: never; - url: '/fine_tuning/alpha/graders/validate'; + body: ValidateGraderRequest; + path?: never; + query?: never; + url: '/fine_tuning/alpha/graders/validate'; }; export type ValidateGraderResponses = { + /** + * OK + */ + 200: ValidateGraderResponse; +}; + +export type ValidateGraderResponse2 = ValidateGraderResponses[keyof ValidateGraderResponses]; + +export type ListFineTuningCheckpointPermissionsData = { + body?: never; + path: { + /** + * The ID of the fine-tuned model checkpoint to get permissions for. + * + */ + fine_tuned_model_checkpoint: string; + }; + query?: { + /** + * The ID of the project to get permissions for. + */ + project_id?: string; + /** + * Identifier for the last permission ID from the previous pagination request. + */ + after?: string; /** - * OK + * Number of permissions to retrieve. */ - 200: ValidateGraderResponse; -}; - -export type ValidateGraderResponse2 = ValidateGraderResponses[keyof ValidateGraderResponses]; - -export type ListFineTuningCheckpointPermissionsData = { - body?: never; - path: { - /** - * The ID of the fine-tuned model checkpoint to get permissions for. - * - */ - fine_tuned_model_checkpoint: string; - }; - query?: { - /** - * The ID of the project to get permissions for. - */ - project_id?: string; - /** - * Identifier for the last permission ID from the previous pagination request. - */ - after?: string; - /** - * Number of permissions to retrieve. - */ - limit?: number; - /** - * The order in which to retrieve permissions. - */ - order?: 'ascending' | 'descending'; - }; - url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions'; + limit?: number; + /** + * The order in which to retrieve permissions. + */ + order?: 'ascending' | 'descending'; + }; + url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions'; }; export type ListFineTuningCheckpointPermissionsResponses = { - /** - * OK - */ - 200: ListFineTuningCheckpointPermissionResponse; + /** + * OK + */ + 200: ListFineTuningCheckpointPermissionResponse; }; -export type ListFineTuningCheckpointPermissionsResponse = ListFineTuningCheckpointPermissionsResponses[keyof ListFineTuningCheckpointPermissionsResponses]; +export type ListFineTuningCheckpointPermissionsResponse = + ListFineTuningCheckpointPermissionsResponses[keyof ListFineTuningCheckpointPermissionsResponses]; export type CreateFineTuningCheckpointPermissionData = { - body: CreateFineTuningCheckpointPermissionRequest; - path: { - /** - * The ID of the fine-tuned model checkpoint to create a permission for. - * - */ - fine_tuned_model_checkpoint: string; - }; - query?: never; - url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions'; + body: CreateFineTuningCheckpointPermissionRequest; + path: { + /** + * The ID of the fine-tuned model checkpoint to create a permission for. + * + */ + fine_tuned_model_checkpoint: string; + }; + query?: never; + url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions'; }; export type CreateFineTuningCheckpointPermissionResponses = { - /** - * OK - */ - 200: ListFineTuningCheckpointPermissionResponse; + /** + * OK + */ + 200: ListFineTuningCheckpointPermissionResponse; }; -export type CreateFineTuningCheckpointPermissionResponse = CreateFineTuningCheckpointPermissionResponses[keyof CreateFineTuningCheckpointPermissionResponses]; +export type CreateFineTuningCheckpointPermissionResponse = + CreateFineTuningCheckpointPermissionResponses[keyof CreateFineTuningCheckpointPermissionResponses]; export type DeleteFineTuningCheckpointPermissionData = { - body?: never; - path: { - /** - * The ID of the fine-tuned model checkpoint to delete a permission for. - * - */ - fine_tuned_model_checkpoint: string; - /** - * The ID of the fine-tuned model checkpoint permission to delete. - * - */ - permission_id: string; - }; - query?: never; - url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}'; + body?: never; + path: { + /** + * The ID of the fine-tuned model checkpoint to delete a permission for. + * + */ + fine_tuned_model_checkpoint: string; + /** + * The ID of the fine-tuned model checkpoint permission to delete. + * + */ + permission_id: string; + }; + query?: never; + url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions/{permission_id}'; }; export type DeleteFineTuningCheckpointPermissionResponses = { - /** - * OK - */ - 200: DeleteFineTuningCheckpointPermissionResponse; + /** + * OK + */ + 200: DeleteFineTuningCheckpointPermissionResponse; }; -export type DeleteFineTuningCheckpointPermissionResponse2 = DeleteFineTuningCheckpointPermissionResponses[keyof DeleteFineTuningCheckpointPermissionResponses]; +export type DeleteFineTuningCheckpointPermissionResponse2 = + DeleteFineTuningCheckpointPermissionResponses[keyof DeleteFineTuningCheckpointPermissionResponses]; export type ListPaginatedFineTuningJobsData = { - body?: never; - path?: never; - query?: { - /** - * Identifier for the last job from the previous pagination request. - */ - after?: string; - /** - * Number of fine-tuning jobs to retrieve. - */ - limit?: number; - /** - * Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata. - * - */ - metadata?: { - [key: string]: string; - }; + body?: never; + path?: never; + query?: { + /** + * Identifier for the last job from the previous pagination request. + */ + after?: string; + /** + * Number of fine-tuning jobs to retrieve. + */ + limit?: number; + /** + * Optional metadata filter. To filter, use the syntax `metadata[k]=v`. Alternatively, set `metadata=null` to indicate no metadata. + * + */ + metadata?: { + [key: string]: string; }; - url: '/fine_tuning/jobs'; + }; + url: '/fine_tuning/jobs'; }; export type ListPaginatedFineTuningJobsResponses = { - /** - * OK - */ - 200: ListPaginatedFineTuningJobsResponse; + /** + * OK + */ + 200: ListPaginatedFineTuningJobsResponse; }; -export type ListPaginatedFineTuningJobsResponse2 = ListPaginatedFineTuningJobsResponses[keyof ListPaginatedFineTuningJobsResponses]; +export type ListPaginatedFineTuningJobsResponse2 = + ListPaginatedFineTuningJobsResponses[keyof ListPaginatedFineTuningJobsResponses]; export type CreateFineTuningJobData = { - body: CreateFineTuningJobRequest; - path?: never; - query?: never; - url: '/fine_tuning/jobs'; + body: CreateFineTuningJobRequest; + path?: never; + query?: never; + url: '/fine_tuning/jobs'; }; export type CreateFineTuningJobResponses = { - /** - * OK - */ - 200: FineTuningJob; + /** + * OK + */ + 200: FineTuningJob; }; -export type CreateFineTuningJobResponse = CreateFineTuningJobResponses[keyof CreateFineTuningJobResponses]; +export type CreateFineTuningJobResponse = + CreateFineTuningJobResponses[keyof CreateFineTuningJobResponses]; export type RetrieveFineTuningJobData = { - body?: never; - path: { - /** - * The ID of the fine-tuning job. - * - */ - fine_tuning_job_id: string; - }; - query?: never; - url: '/fine_tuning/jobs/{fine_tuning_job_id}'; + body?: never; + path: { + /** + * The ID of the fine-tuning job. + * + */ + fine_tuning_job_id: string; + }; + query?: never; + url: '/fine_tuning/jobs/{fine_tuning_job_id}'; }; export type RetrieveFineTuningJobResponses = { - /** - * OK - */ - 200: FineTuningJob; + /** + * OK + */ + 200: FineTuningJob; }; -export type RetrieveFineTuningJobResponse = RetrieveFineTuningJobResponses[keyof RetrieveFineTuningJobResponses]; +export type RetrieveFineTuningJobResponse = + RetrieveFineTuningJobResponses[keyof RetrieveFineTuningJobResponses]; export type CancelFineTuningJobData = { - body?: never; - path: { - /** - * The ID of the fine-tuning job to cancel. - * - */ - fine_tuning_job_id: string; - }; - query?: never; - url: '/fine_tuning/jobs/{fine_tuning_job_id}/cancel'; + body?: never; + path: { + /** + * The ID of the fine-tuning job to cancel. + * + */ + fine_tuning_job_id: string; + }; + query?: never; + url: '/fine_tuning/jobs/{fine_tuning_job_id}/cancel'; }; export type CancelFineTuningJobResponses = { - /** - * OK - */ - 200: FineTuningJob; + /** + * OK + */ + 200: FineTuningJob; }; -export type CancelFineTuningJobResponse = CancelFineTuningJobResponses[keyof CancelFineTuningJobResponses]; +export type CancelFineTuningJobResponse = + CancelFineTuningJobResponses[keyof CancelFineTuningJobResponses]; export type ListFineTuningJobCheckpointsData = { - body?: never; - path: { - /** - * The ID of the fine-tuning job to get checkpoints for. - * - */ - fine_tuning_job_id: string; - }; - query?: { - /** - * Identifier for the last checkpoint ID from the previous pagination request. - */ - after?: string; - /** - * Number of checkpoints to retrieve. - */ - limit?: number; - }; - url: '/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints'; + body?: never; + path: { + /** + * The ID of the fine-tuning job to get checkpoints for. + * + */ + fine_tuning_job_id: string; + }; + query?: { + /** + * Identifier for the last checkpoint ID from the previous pagination request. + */ + after?: string; + /** + * Number of checkpoints to retrieve. + */ + limit?: number; + }; + url: '/fine_tuning/jobs/{fine_tuning_job_id}/checkpoints'; }; export type ListFineTuningJobCheckpointsResponses = { - /** - * OK - */ - 200: ListFineTuningJobCheckpointsResponse; + /** + * OK + */ + 200: ListFineTuningJobCheckpointsResponse; }; -export type ListFineTuningJobCheckpointsResponse2 = ListFineTuningJobCheckpointsResponses[keyof ListFineTuningJobCheckpointsResponses]; +export type ListFineTuningJobCheckpointsResponse2 = + ListFineTuningJobCheckpointsResponses[keyof ListFineTuningJobCheckpointsResponses]; export type ListFineTuningEventsData = { - body?: never; - path: { - /** - * The ID of the fine-tuning job to get events for. - * - */ - fine_tuning_job_id: string; - }; - query?: { - /** - * Identifier for the last event from the previous pagination request. - */ - after?: string; - /** - * Number of events to retrieve. - */ - limit?: number; - }; - url: '/fine_tuning/jobs/{fine_tuning_job_id}/events'; + body?: never; + path: { + /** + * The ID of the fine-tuning job to get events for. + * + */ + fine_tuning_job_id: string; + }; + query?: { + /** + * Identifier for the last event from the previous pagination request. + */ + after?: string; + /** + * Number of events to retrieve. + */ + limit?: number; + }; + url: '/fine_tuning/jobs/{fine_tuning_job_id}/events'; }; export type ListFineTuningEventsResponses = { - /** - * OK - */ - 200: ListFineTuningJobEventsResponse; + /** + * OK + */ + 200: ListFineTuningJobEventsResponse; }; -export type ListFineTuningEventsResponse = ListFineTuningEventsResponses[keyof ListFineTuningEventsResponses]; +export type ListFineTuningEventsResponse = + ListFineTuningEventsResponses[keyof ListFineTuningEventsResponses]; export type PauseFineTuningJobData = { - body?: never; - path: { - /** - * The ID of the fine-tuning job to pause. - * - */ - fine_tuning_job_id: string; - }; - query?: never; - url: '/fine_tuning/jobs/{fine_tuning_job_id}/pause'; + body?: never; + path: { + /** + * The ID of the fine-tuning job to pause. + * + */ + fine_tuning_job_id: string; + }; + query?: never; + url: '/fine_tuning/jobs/{fine_tuning_job_id}/pause'; }; export type PauseFineTuningJobResponses = { - /** - * OK - */ - 200: FineTuningJob; + /** + * OK + */ + 200: FineTuningJob; }; -export type PauseFineTuningJobResponse = PauseFineTuningJobResponses[keyof PauseFineTuningJobResponses]; +export type PauseFineTuningJobResponse = + PauseFineTuningJobResponses[keyof PauseFineTuningJobResponses]; export type ResumeFineTuningJobData = { - body?: never; - path: { - /** - * The ID of the fine-tuning job to resume. - * - */ - fine_tuning_job_id: string; - }; - query?: never; - url: '/fine_tuning/jobs/{fine_tuning_job_id}/resume'; + body?: never; + path: { + /** + * The ID of the fine-tuning job to resume. + * + */ + fine_tuning_job_id: string; + }; + query?: never; + url: '/fine_tuning/jobs/{fine_tuning_job_id}/resume'; }; export type ResumeFineTuningJobResponses = { - /** - * OK - */ - 200: FineTuningJob; + /** + * OK + */ + 200: FineTuningJob; }; -export type ResumeFineTuningJobResponse = ResumeFineTuningJobResponses[keyof ResumeFineTuningJobResponses]; +export type ResumeFineTuningJobResponse = + ResumeFineTuningJobResponses[keyof ResumeFineTuningJobResponses]; export type CreateImageEditData = { - body: CreateImageEditRequest; - path?: never; - query?: never; - url: '/images/edits'; + body: CreateImageEditRequest; + path?: never; + query?: never; + url: '/images/edits'; }; export type CreateImageEditResponses = { - /** - * OK - */ - 200: ImagesResponse; + /** + * OK + */ + 200: ImagesResponse; }; export type CreateImageEditResponse = CreateImageEditResponses[keyof CreateImageEditResponses]; export type CreateImageData = { - body: CreateImageRequest; - path?: never; - query?: never; - url: '/images/generations'; + body: CreateImageRequest; + path?: never; + query?: never; + url: '/images/generations'; }; export type CreateImageResponses = { - /** - * OK - */ - 200: ImagesResponse; + /** + * OK + */ + 200: ImagesResponse; }; export type CreateImageResponse = CreateImageResponses[keyof CreateImageResponses]; export type CreateImageVariationData = { - body: CreateImageVariationRequest; - path?: never; - query?: never; - url: '/images/variations'; + body: CreateImageVariationRequest; + path?: never; + query?: never; + url: '/images/variations'; }; export type CreateImageVariationResponses = { - /** - * OK - */ - 200: ImagesResponse; + /** + * OK + */ + 200: ImagesResponse; }; -export type CreateImageVariationResponse = CreateImageVariationResponses[keyof CreateImageVariationResponses]; +export type CreateImageVariationResponse = + CreateImageVariationResponses[keyof CreateImageVariationResponses]; export type ListModelsData = { - body?: never; - path?: never; - query?: never; - url: '/models'; + body?: never; + path?: never; + query?: never; + url: '/models'; }; export type ListModelsResponses = { - /** - * OK - */ - 200: ListModelsResponse; + /** + * OK + */ + 200: ListModelsResponse; }; export type ListModelsResponse2 = ListModelsResponses[keyof ListModelsResponses]; export type DeleteModelData = { - body?: never; - path: { - /** - * The model to delete - */ - model: string; - }; - query?: never; - url: '/models/{model}'; + body?: never; + path: { + /** + * The model to delete + */ + model: string; + }; + query?: never; + url: '/models/{model}'; }; export type DeleteModelResponses = { - /** - * OK - */ - 200: DeleteModelResponse; + /** + * OK + */ + 200: DeleteModelResponse; }; export type DeleteModelResponse2 = DeleteModelResponses[keyof DeleteModelResponses]; export type RetrieveModelData = { - body?: never; - path: { - /** - * The ID of the model to use for this request - */ - model: string; - }; - query?: never; - url: '/models/{model}'; + body?: never; + path: { + /** + * The ID of the model to use for this request + */ + model: string; + }; + query?: never; + url: '/models/{model}'; }; export type RetrieveModelResponses = { - /** - * OK - */ - 200: Model; + /** + * OK + */ + 200: Model; }; export type RetrieveModelResponse = RetrieveModelResponses[keyof RetrieveModelResponses]; export type CreateModerationData = { - body: CreateModerationRequest; - path?: never; - query?: never; - url: '/moderations'; + body: CreateModerationRequest; + path?: never; + query?: never; + url: '/moderations'; }; export type CreateModerationResponses = { - /** - * OK - */ - 200: CreateModerationResponse; + /** + * OK + */ + 200: CreateModerationResponse; }; export type CreateModerationResponse2 = CreateModerationResponses[keyof CreateModerationResponses]; export type AdminApiKeysListData = { - body?: never; - path?: never; - query?: { - /** - * Return keys with IDs that come after this ID in the pagination order. - */ - after?: string; - /** - * Order results by creation time, ascending or descending. - */ - order?: 'asc' | 'desc'; - /** - * Maximum number of keys to return. - */ - limit?: number; - }; - url: '/organization/admin_api_keys'; + body?: never; + path?: never; + query?: { + /** + * Return keys with IDs that come after this ID in the pagination order. + */ + after?: string; + /** + * Order results by creation time, ascending or descending. + */ + order?: 'asc' | 'desc'; + /** + * Maximum number of keys to return. + */ + limit?: number; + }; + url: '/organization/admin_api_keys'; }; export type AdminApiKeysListResponses = { - /** - * A list of organization API keys. - */ - 200: ApiKeyList; + /** + * A list of organization API keys. + */ + 200: ApiKeyList; }; export type AdminApiKeysListResponse = AdminApiKeysListResponses[keyof AdminApiKeysListResponses]; export type AdminApiKeysCreateData = { - body: { - name: string; - }; - path?: never; - query?: never; - url: '/organization/admin_api_keys'; + body: { + name: string; + }; + path?: never; + query?: never; + url: '/organization/admin_api_keys'; }; export type AdminApiKeysCreateResponses = { - /** - * The newly created admin API key. - */ - 200: AdminApiKey; + /** + * The newly created admin API key. + */ + 200: AdminApiKey; }; -export type AdminApiKeysCreateResponse = AdminApiKeysCreateResponses[keyof AdminApiKeysCreateResponses]; +export type AdminApiKeysCreateResponse = + AdminApiKeysCreateResponses[keyof AdminApiKeysCreateResponses]; export type AdminApiKeysDeleteData = { - body?: never; - path: { - /** - * The ID of the API key to be deleted. - */ - key_id: string; - }; - query?: never; - url: '/organization/admin_api_keys/{key_id}'; + body?: never; + path: { + /** + * The ID of the API key to be deleted. + */ + key_id: string; + }; + query?: never; + url: '/organization/admin_api_keys/{key_id}'; }; export type AdminApiKeysDeleteResponses = { - /** - * Confirmation that the API key was deleted. - */ - 200: { - id?: string; - object?: string; - deleted?: boolean; - }; + /** + * Confirmation that the API key was deleted. + */ + 200: { + id?: string; + object?: string; + deleted?: boolean; + }; }; -export type AdminApiKeysDeleteResponse = AdminApiKeysDeleteResponses[keyof AdminApiKeysDeleteResponses]; +export type AdminApiKeysDeleteResponse = + AdminApiKeysDeleteResponses[keyof AdminApiKeysDeleteResponses]; export type AdminApiKeysGetData = { - body?: never; - path: { - /** - * The ID of the API key. - */ - key_id: string; - }; - query?: never; - url: '/organization/admin_api_keys/{key_id}'; + body?: never; + path: { + /** + * The ID of the API key. + */ + key_id: string; + }; + query?: never; + url: '/organization/admin_api_keys/{key_id}'; }; export type AdminApiKeysGetResponses = { - /** - * Details of the requested API key. - */ - 200: AdminApiKey; + /** + * Details of the requested API key. + */ + 200: AdminApiKey; }; export type AdminApiKeysGetResponse = AdminApiKeysGetResponses[keyof AdminApiKeysGetResponses]; export type ListAuditLogsData = { - body?: never; - path?: never; - query?: { - /** - * Return only events whose `effective_at` (Unix seconds) is in this range. - */ - effective_at?: { - /** - * Return only events whose `effective_at` (Unix seconds) is greater than this value. - */ - gt?: number; - /** - * Return only events whose `effective_at` (Unix seconds) is greater than or equal to this value. - */ - gte?: number; - /** - * Return only events whose `effective_at` (Unix seconds) is less than this value. - */ - lt?: number; - /** - * Return only events whose `effective_at` (Unix seconds) is less than or equal to this value. - */ - lte?: number; - }; - /** - * Return only events for these projects. - */ - 'project_ids[]'?: Array; - /** - * Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object). - */ - 'event_types[]'?: Array; - /** - * Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID. - */ - 'actor_ids[]'?: Array; - /** - * Return only events performed by users with these emails. - */ - 'actor_emails[]'?: Array; - /** - * Return only events performed on these targets. For example, a project ID updated. - */ - 'resource_ids[]'?: Array; - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; + body?: never; + path?: never; + query?: { + /** + * Return only events whose `effective_at` (Unix seconds) is in this range. + */ + effective_at?: { + /** + * Return only events whose `effective_at` (Unix seconds) is greater than this value. + */ + gt?: number; + /** + * Return only events whose `effective_at` (Unix seconds) is greater than or equal to this value. + */ + gte?: number; + /** + * Return only events whose `effective_at` (Unix seconds) is less than this value. + */ + lt?: number; + /** + * Return only events whose `effective_at` (Unix seconds) is less than or equal to this value. + */ + lte?: number; }; - url: '/organization/audit_logs'; + /** + * Return only events for these projects. + */ + 'project_ids[]'?: Array; + /** + * Return only events with a `type` in one of these values. For example, `project.created`. For all options, see the documentation for the [audit log object](https://platform.openai.com/docs/api-reference/audit-logs/object). + */ + 'event_types[]'?: Array; + /** + * Return only events performed by these actors. Can be a user ID, a service account ID, or an api key tracking ID. + */ + 'actor_ids[]'?: Array; + /** + * Return only events performed by users with these emails. + */ + 'actor_emails[]'?: Array; + /** + * Return only events performed on these targets. For example, a project ID updated. + */ + 'resource_ids[]'?: Array; + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + }; + url: '/organization/audit_logs'; }; export type ListAuditLogsResponses = { - /** - * Audit logs listed successfully. - */ - 200: ListAuditLogsResponse; + /** + * Audit logs listed successfully. + */ + 200: ListAuditLogsResponse; }; export type ListAuditLogsResponse2 = ListAuditLogsResponses[keyof ListAuditLogsResponses]; export type ListOrganizationCertificatesData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - }; - url: '/organization/certificates'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + }; + url: '/organization/certificates'; }; export type ListOrganizationCertificatesResponses = { - /** - * Certificates listed successfully. - */ - 200: ListCertificatesResponse; + /** + * Certificates listed successfully. + */ + 200: ListCertificatesResponse; }; -export type ListOrganizationCertificatesResponse = ListOrganizationCertificatesResponses[keyof ListOrganizationCertificatesResponses]; +export type ListOrganizationCertificatesResponse = + ListOrganizationCertificatesResponses[keyof ListOrganizationCertificatesResponses]; export type UploadCertificateData = { - /** - * The certificate upload payload. - */ - body: UploadCertificateRequest; - path?: never; - query?: never; - url: '/organization/certificates'; + /** + * The certificate upload payload. + */ + body: UploadCertificateRequest; + path?: never; + query?: never; + url: '/organization/certificates'; }; export type UploadCertificateResponses = { - /** - * Certificate uploaded successfully. - */ - 200: Certificate; + /** + * Certificate uploaded successfully. + */ + 200: Certificate; }; -export type UploadCertificateResponse = UploadCertificateResponses[keyof UploadCertificateResponses]; +export type UploadCertificateResponse = + UploadCertificateResponses[keyof UploadCertificateResponses]; export type ActivateOrganizationCertificatesData = { - /** - * The certificate activation payload. - */ - body: ToggleCertificatesRequest; - path?: never; - query?: never; - url: '/organization/certificates/activate'; + /** + * The certificate activation payload. + */ + body: ToggleCertificatesRequest; + path?: never; + query?: never; + url: '/organization/certificates/activate'; }; export type ActivateOrganizationCertificatesResponses = { - /** - * Certificates activated successfully. - */ - 200: ListCertificatesResponse; + /** + * Certificates activated successfully. + */ + 200: ListCertificatesResponse; }; -export type ActivateOrganizationCertificatesResponse = ActivateOrganizationCertificatesResponses[keyof ActivateOrganizationCertificatesResponses]; +export type ActivateOrganizationCertificatesResponse = + ActivateOrganizationCertificatesResponses[keyof ActivateOrganizationCertificatesResponses]; export type DeactivateOrganizationCertificatesData = { - /** - * The certificate deactivation payload. - */ - body: ToggleCertificatesRequest; - path?: never; - query?: never; - url: '/organization/certificates/deactivate'; + /** + * The certificate deactivation payload. + */ + body: ToggleCertificatesRequest; + path?: never; + query?: never; + url: '/organization/certificates/deactivate'; }; export type DeactivateOrganizationCertificatesResponses = { - /** - * Certificates deactivated successfully. - */ - 200: ListCertificatesResponse; + /** + * Certificates deactivated successfully. + */ + 200: ListCertificatesResponse; }; -export type DeactivateOrganizationCertificatesResponse = DeactivateOrganizationCertificatesResponses[keyof DeactivateOrganizationCertificatesResponses]; +export type DeactivateOrganizationCertificatesResponse = + DeactivateOrganizationCertificatesResponses[keyof DeactivateOrganizationCertificatesResponses]; export type DeleteCertificateData = { - body?: never; - path?: never; - query?: never; - url: '/organization/certificates/{certificate_id}'; + body?: never; + path?: never; + query?: never; + url: '/organization/certificates/{certificate_id}'; }; export type DeleteCertificateResponses = { - /** - * Certificate deleted successfully. - */ - 200: DeleteCertificateResponse; + /** + * Certificate deleted successfully. + */ + 200: DeleteCertificateResponse; }; -export type DeleteCertificateResponse2 = DeleteCertificateResponses[keyof DeleteCertificateResponses]; +export type DeleteCertificateResponse2 = + DeleteCertificateResponses[keyof DeleteCertificateResponses]; export type GetCertificateData = { - body?: never; - path: { - /** - * Unique ID of the certificate to retrieve. - */ - certificate_id: string; - }; - query?: { - /** - * A list of additional fields to include in the response. Currently the only supported value is `content` to fetch the PEM content of the certificate. - */ - include?: Array<'content'>; - }; - url: '/organization/certificates/{certificate_id}'; + body?: never; + path: { + /** + * Unique ID of the certificate to retrieve. + */ + certificate_id: string; + }; + query?: { + /** + * A list of additional fields to include in the response. Currently the only supported value is `content` to fetch the PEM content of the certificate. + */ + include?: Array<'content'>; + }; + url: '/organization/certificates/{certificate_id}'; }; export type GetCertificateResponses = { - /** - * Certificate retrieved successfully. - */ - 200: Certificate; + /** + * Certificate retrieved successfully. + */ + 200: Certificate; }; export type GetCertificateResponse = GetCertificateResponses[keyof GetCertificateResponses]; export type ModifyCertificateData = { - /** - * The certificate modification payload. - */ - body: ModifyCertificateRequest; - path?: never; - query?: never; - url: '/organization/certificates/{certificate_id}'; + /** + * The certificate modification payload. + */ + body: ModifyCertificateRequest; + path?: never; + query?: never; + url: '/organization/certificates/{certificate_id}'; }; export type ModifyCertificateResponses = { - /** - * Certificate modified successfully. - */ - 200: Certificate; + /** + * Certificate modified successfully. + */ + 200: Certificate; }; -export type ModifyCertificateResponse = ModifyCertificateResponses[keyof ModifyCertificateResponses]; +export type ModifyCertificateResponse = + ModifyCertificateResponses[keyof ModifyCertificateResponses]; export type UsageCostsData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. - */ - bucket_width?: '1d'; - /** - * Return only costs for these projects. - */ - project_ids?: Array; - /** - * Group the costs by the specified fields. Support fields include `project_id`, `line_item` and any combination of them. - */ - group_by?: Array<'project_id' | 'line_item'>; - /** - * A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7. - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/costs'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. + */ + bucket_width?: '1d'; + /** + * Return only costs for these projects. + */ + project_ids?: Array; + /** + * Group the costs by the specified fields. Support fields include `project_id`, `line_item` and any combination of them. + */ + group_by?: Array<'project_id' | 'line_item'>; + /** + * A limit on the number of buckets to be returned. Limit can range between 1 and 180, and the default is 7. + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/costs'; }; export type UsageCostsResponses = { - /** - * Costs data retrieved successfully. - */ - 200: UsageResponse; + /** + * Costs data retrieved successfully. + */ + 200: UsageResponse; }; export type UsageCostsResponse = UsageCostsResponses[keyof UsageCostsResponses]; export type ListInvitesData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/organization/invites'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/organization/invites'; }; export type ListInvitesResponses = { - /** - * Invites listed successfully. - */ - 200: InviteListResponse; + /** + * Invites listed successfully. + */ + 200: InviteListResponse; }; export type ListInvitesResponse = ListInvitesResponses[keyof ListInvitesResponses]; export type InviteUserData = { - /** - * The invite request payload. - */ - body: InviteRequest; - path?: never; - query?: never; - url: '/organization/invites'; + /** + * The invite request payload. + */ + body: InviteRequest; + path?: never; + query?: never; + url: '/organization/invites'; }; export type InviteUserResponses = { - /** - * User invited successfully. - */ - 200: Invite; + /** + * User invited successfully. + */ + 200: Invite; }; export type InviteUserResponse = InviteUserResponses[keyof InviteUserResponses]; export type DeleteInviteData = { - body?: never; - path: { - /** - * The ID of the invite to delete. - */ - invite_id: string; - }; - query?: never; - url: '/organization/invites/{invite_id}'; + body?: never; + path: { + /** + * The ID of the invite to delete. + */ + invite_id: string; + }; + query?: never; + url: '/organization/invites/{invite_id}'; }; export type DeleteInviteResponses = { - /** - * Invite deleted successfully. - */ - 200: InviteDeleteResponse; + /** + * Invite deleted successfully. + */ + 200: InviteDeleteResponse; }; export type DeleteInviteResponse = DeleteInviteResponses[keyof DeleteInviteResponses]; export type RetrieveInviteData = { - body?: never; - path: { - /** - * The ID of the invite to retrieve. - */ - invite_id: string; - }; - query?: never; - url: '/organization/invites/{invite_id}'; + body?: never; + path: { + /** + * The ID of the invite to retrieve. + */ + invite_id: string; + }; + query?: never; + url: '/organization/invites/{invite_id}'; }; export type RetrieveInviteResponses = { - /** - * Invite retrieved successfully. - */ - 200: Invite; + /** + * Invite retrieved successfully. + */ + 200: Invite; }; export type RetrieveInviteResponse = RetrieveInviteResponses[keyof RetrieveInviteResponses]; export type ListProjectsData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. - */ - include_archived?: boolean; - }; - url: '/organization/projects'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. + */ + include_archived?: boolean; + }; + url: '/organization/projects'; }; export type ListProjectsResponses = { - /** - * Projects listed successfully. - */ - 200: ProjectListResponse; + /** + * Projects listed successfully. + */ + 200: ProjectListResponse; }; export type ListProjectsResponse = ListProjectsResponses[keyof ListProjectsResponses]; export type CreateProjectData = { - /** - * The project create request payload. - */ - body: ProjectCreateRequest; - path?: never; - query?: never; - url: '/organization/projects'; + /** + * The project create request payload. + */ + body: ProjectCreateRequest; + path?: never; + query?: never; + url: '/organization/projects'; }; export type CreateProjectResponses = { - /** - * Project created successfully. - */ - 200: Project; + /** + * Project created successfully. + */ + 200: Project; }; export type CreateProjectResponse = CreateProjectResponses[keyof CreateProjectResponses]; export type RetrieveProjectData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}'; }; export type RetrieveProjectResponses = { - /** - * Project retrieved successfully. - */ - 200: Project; + /** + * Project retrieved successfully. + */ + 200: Project; }; export type RetrieveProjectResponse = RetrieveProjectResponses[keyof RetrieveProjectResponses]; export type ModifyProjectData = { + /** + * The project update request payload. + */ + body: ProjectUpdateRequest; + path: { /** - * The project update request payload. + * The ID of the project. */ - body: ProjectUpdateRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}'; + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}'; }; export type ModifyProjectErrors = { - /** - * Error response when updating the default project. - */ - 400: ErrorResponse; + /** + * Error response when updating the default project. + */ + 400: ErrorResponse; }; export type ModifyProjectError = ModifyProjectErrors[keyof ModifyProjectErrors]; export type ModifyProjectResponses = { - /** - * Project updated successfully. - */ - 200: Project; + /** + * Project updated successfully. + */ + 200: Project; }; export type ModifyProjectResponse = ModifyProjectResponses[keyof ModifyProjectResponses]; export type ListProjectApiKeysData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/organization/projects/{project_id}/api_keys'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/organization/projects/{project_id}/api_keys'; }; export type ListProjectApiKeysResponses = { - /** - * Project API keys listed successfully. - */ - 200: ProjectApiKeyListResponse; + /** + * Project API keys listed successfully. + */ + 200: ProjectApiKeyListResponse; }; -export type ListProjectApiKeysResponse = ListProjectApiKeysResponses[keyof ListProjectApiKeysResponses]; +export type ListProjectApiKeysResponse = + ListProjectApiKeysResponses[keyof ListProjectApiKeysResponses]; export type DeleteProjectApiKeyData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the API key. - */ - key_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/api_keys/{key_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + /** + * The ID of the API key. + */ + key_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/api_keys/{key_id}'; }; export type DeleteProjectApiKeyErrors = { - /** - * Error response for various conditions. - */ - 400: ErrorResponse; + /** + * Error response for various conditions. + */ + 400: ErrorResponse; }; export type DeleteProjectApiKeyError = DeleteProjectApiKeyErrors[keyof DeleteProjectApiKeyErrors]; export type DeleteProjectApiKeyResponses = { - /** - * Project API key deleted successfully. - */ - 200: ProjectApiKeyDeleteResponse; + /** + * Project API key deleted successfully. + */ + 200: ProjectApiKeyDeleteResponse; }; -export type DeleteProjectApiKeyResponse = DeleteProjectApiKeyResponses[keyof DeleteProjectApiKeyResponses]; +export type DeleteProjectApiKeyResponse = + DeleteProjectApiKeyResponses[keyof DeleteProjectApiKeyResponses]; export type RetrieveProjectApiKeyData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the API key. - */ - key_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/api_keys/{key_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + /** + * The ID of the API key. + */ + key_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/api_keys/{key_id}'; }; export type RetrieveProjectApiKeyResponses = { - /** - * Project API key retrieved successfully. - */ - 200: ProjectApiKey; + /** + * Project API key retrieved successfully. + */ + 200: ProjectApiKey; }; -export type RetrieveProjectApiKeyResponse = RetrieveProjectApiKeyResponses[keyof RetrieveProjectApiKeyResponses]; +export type RetrieveProjectApiKeyResponse = + RetrieveProjectApiKeyResponses[keyof RetrieveProjectApiKeyResponses]; export type ArchiveProjectData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/archive'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/archive'; }; export type ArchiveProjectResponses = { - /** - * Project archived successfully. - */ - 200: Project; + /** + * Project archived successfully. + */ + 200: Project; }; export type ArchiveProjectResponse = ArchiveProjectResponses[keyof ArchiveProjectResponses]; export type ListProjectCertificatesData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - }; - url: '/organization/projects/{project_id}/certificates'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + }; + url: '/organization/projects/{project_id}/certificates'; }; export type ListProjectCertificatesResponses = { - /** - * Certificates listed successfully. - */ - 200: ListCertificatesResponse; + /** + * Certificates listed successfully. + */ + 200: ListCertificatesResponse; }; -export type ListProjectCertificatesResponse = ListProjectCertificatesResponses[keyof ListProjectCertificatesResponses]; +export type ListProjectCertificatesResponse = + ListProjectCertificatesResponses[keyof ListProjectCertificatesResponses]; export type ActivateProjectCertificatesData = { + /** + * The certificate activation payload. + */ + body: ToggleCertificatesRequest; + path: { /** - * The certificate activation payload. + * The ID of the project. */ - body: ToggleCertificatesRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/certificates/activate'; + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/certificates/activate'; }; export type ActivateProjectCertificatesResponses = { - /** - * Certificates activated successfully. - */ - 200: ListCertificatesResponse; + /** + * Certificates activated successfully. + */ + 200: ListCertificatesResponse; }; -export type ActivateProjectCertificatesResponse = ActivateProjectCertificatesResponses[keyof ActivateProjectCertificatesResponses]; +export type ActivateProjectCertificatesResponse = + ActivateProjectCertificatesResponses[keyof ActivateProjectCertificatesResponses]; export type DeactivateProjectCertificatesData = { + /** + * The certificate deactivation payload. + */ + body: ToggleCertificatesRequest; + path: { /** - * The certificate deactivation payload. + * The ID of the project. */ - body: ToggleCertificatesRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/certificates/deactivate'; + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/certificates/deactivate'; }; export type DeactivateProjectCertificatesResponses = { - /** - * Certificates deactivated successfully. - */ - 200: ListCertificatesResponse; + /** + * Certificates deactivated successfully. + */ + 200: ListCertificatesResponse; }; -export type DeactivateProjectCertificatesResponse = DeactivateProjectCertificatesResponses[keyof DeactivateProjectCertificatesResponses]; +export type DeactivateProjectCertificatesResponse = + DeactivateProjectCertificatesResponses[keyof DeactivateProjectCertificatesResponses]; export type ListProjectRateLimitsData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. The default is 100. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - }; - url: '/organization/projects/{project_id}/rate_limits'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. The default is 100. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, beginning with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + }; + url: '/organization/projects/{project_id}/rate_limits'; }; export type ListProjectRateLimitsResponses = { - /** - * Project rate limits listed successfully. - */ - 200: ProjectRateLimitListResponse; + /** + * Project rate limits listed successfully. + */ + 200: ProjectRateLimitListResponse; }; -export type ListProjectRateLimitsResponse = ListProjectRateLimitsResponses[keyof ListProjectRateLimitsResponses]; +export type ListProjectRateLimitsResponse = + ListProjectRateLimitsResponses[keyof ListProjectRateLimitsResponses]; export type UpdateProjectRateLimitsData = { + /** + * The project rate limit update request payload. + */ + body: ProjectRateLimitUpdateRequest; + path: { /** - * The project rate limit update request payload. + * The ID of the project. */ - body: ProjectRateLimitUpdateRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the rate limit. - */ - rate_limit_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/rate_limits/{rate_limit_id}'; + project_id: string; + /** + * The ID of the rate limit. + */ + rate_limit_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/rate_limits/{rate_limit_id}'; }; export type UpdateProjectRateLimitsErrors = { - /** - * Error response for various conditions. - */ - 400: ErrorResponse; + /** + * Error response for various conditions. + */ + 400: ErrorResponse; }; -export type UpdateProjectRateLimitsError = UpdateProjectRateLimitsErrors[keyof UpdateProjectRateLimitsErrors]; +export type UpdateProjectRateLimitsError = + UpdateProjectRateLimitsErrors[keyof UpdateProjectRateLimitsErrors]; export type UpdateProjectRateLimitsResponses = { - /** - * Project rate limit updated successfully. - */ - 200: ProjectRateLimit; + /** + * Project rate limit updated successfully. + */ + 200: ProjectRateLimit; }; -export type UpdateProjectRateLimitsResponse = UpdateProjectRateLimitsResponses[keyof UpdateProjectRateLimitsResponses]; +export type UpdateProjectRateLimitsResponse = + UpdateProjectRateLimitsResponses[keyof UpdateProjectRateLimitsResponses]; export type ListProjectServiceAccountsData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/organization/projects/{project_id}/service_accounts'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/organization/projects/{project_id}/service_accounts'; }; export type ListProjectServiceAccountsErrors = { - /** - * Error response when project is archived. - */ - 400: ErrorResponse; + /** + * Error response when project is archived. + */ + 400: ErrorResponse; }; -export type ListProjectServiceAccountsError = ListProjectServiceAccountsErrors[keyof ListProjectServiceAccountsErrors]; +export type ListProjectServiceAccountsError = + ListProjectServiceAccountsErrors[keyof ListProjectServiceAccountsErrors]; export type ListProjectServiceAccountsResponses = { - /** - * Project service accounts listed successfully. - */ - 200: ProjectServiceAccountListResponse; + /** + * Project service accounts listed successfully. + */ + 200: ProjectServiceAccountListResponse; }; -export type ListProjectServiceAccountsResponse = ListProjectServiceAccountsResponses[keyof ListProjectServiceAccountsResponses]; +export type ListProjectServiceAccountsResponse = + ListProjectServiceAccountsResponses[keyof ListProjectServiceAccountsResponses]; export type CreateProjectServiceAccountData = { + /** + * The project service account create request payload. + */ + body: ProjectServiceAccountCreateRequest; + path: { /** - * The project service account create request payload. + * The ID of the project. */ - body: ProjectServiceAccountCreateRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/service_accounts'; + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/service_accounts'; }; export type CreateProjectServiceAccountErrors = { - /** - * Error response when project is archived. - */ - 400: ErrorResponse; + /** + * Error response when project is archived. + */ + 400: ErrorResponse; }; -export type CreateProjectServiceAccountError = CreateProjectServiceAccountErrors[keyof CreateProjectServiceAccountErrors]; +export type CreateProjectServiceAccountError = + CreateProjectServiceAccountErrors[keyof CreateProjectServiceAccountErrors]; export type CreateProjectServiceAccountResponses = { - /** - * Project service account created successfully. - */ - 200: ProjectServiceAccountCreateResponse; + /** + * Project service account created successfully. + */ + 200: ProjectServiceAccountCreateResponse; }; -export type CreateProjectServiceAccountResponse = CreateProjectServiceAccountResponses[keyof CreateProjectServiceAccountResponses]; +export type CreateProjectServiceAccountResponse = + CreateProjectServiceAccountResponses[keyof CreateProjectServiceAccountResponses]; export type DeleteProjectServiceAccountData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the service account. - */ - service_account_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/service_accounts/{service_account_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + /** + * The ID of the service account. + */ + service_account_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/service_accounts/{service_account_id}'; }; export type DeleteProjectServiceAccountResponses = { - /** - * Project service account deleted successfully. - */ - 200: ProjectServiceAccountDeleteResponse; + /** + * Project service account deleted successfully. + */ + 200: ProjectServiceAccountDeleteResponse; }; -export type DeleteProjectServiceAccountResponse = DeleteProjectServiceAccountResponses[keyof DeleteProjectServiceAccountResponses]; +export type DeleteProjectServiceAccountResponse = + DeleteProjectServiceAccountResponses[keyof DeleteProjectServiceAccountResponses]; export type RetrieveProjectServiceAccountData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the service account. - */ - service_account_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/service_accounts/{service_account_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + /** + * The ID of the service account. + */ + service_account_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/service_accounts/{service_account_id}'; }; export type RetrieveProjectServiceAccountResponses = { - /** - * Project service account retrieved successfully. - */ - 200: ProjectServiceAccount; + /** + * Project service account retrieved successfully. + */ + 200: ProjectServiceAccount; }; -export type RetrieveProjectServiceAccountResponse = RetrieveProjectServiceAccountResponses[keyof RetrieveProjectServiceAccountResponses]; +export type RetrieveProjectServiceAccountResponse = + RetrieveProjectServiceAccountResponses[keyof RetrieveProjectServiceAccountResponses]; export type ListProjectUsersData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - }; - url: '/organization/projects/{project_id}/users'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + }; + url: '/organization/projects/{project_id}/users'; }; export type ListProjectUsersErrors = { - /** - * Error response when project is archived. - */ - 400: ErrorResponse; + /** + * Error response when project is archived. + */ + 400: ErrorResponse; }; export type ListProjectUsersError = ListProjectUsersErrors[keyof ListProjectUsersErrors]; export type ListProjectUsersResponses = { - /** - * Project users listed successfully. - */ - 200: ProjectUserListResponse; + /** + * Project users listed successfully. + */ + 200: ProjectUserListResponse; }; export type ListProjectUsersResponse = ListProjectUsersResponses[keyof ListProjectUsersResponses]; export type CreateProjectUserData = { + /** + * The project user create request payload. + */ + body: ProjectUserCreateRequest; + path: { /** - * The project user create request payload. + * The ID of the project. */ - body: ProjectUserCreateRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/users'; + project_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/users'; }; export type CreateProjectUserErrors = { - /** - * Error response for various conditions. - */ - 400: ErrorResponse; + /** + * Error response for various conditions. + */ + 400: ErrorResponse; }; export type CreateProjectUserError = CreateProjectUserErrors[keyof CreateProjectUserErrors]; export type CreateProjectUserResponses = { - /** - * User added to project successfully. - */ - 200: ProjectUser; + /** + * User added to project successfully. + */ + 200: ProjectUser; }; -export type CreateProjectUserResponse = CreateProjectUserResponses[keyof CreateProjectUserResponses]; +export type CreateProjectUserResponse = + CreateProjectUserResponses[keyof CreateProjectUserResponses]; export type DeleteProjectUserData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the user. - */ - user_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/users/{user_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + /** + * The ID of the user. + */ + user_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/users/{user_id}'; }; export type DeleteProjectUserErrors = { - /** - * Error response for various conditions. - */ - 400: ErrorResponse; + /** + * Error response for various conditions. + */ + 400: ErrorResponse; }; export type DeleteProjectUserError = DeleteProjectUserErrors[keyof DeleteProjectUserErrors]; export type DeleteProjectUserResponses = { - /** - * Project user deleted successfully. - */ - 200: ProjectUserDeleteResponse; + /** + * Project user deleted successfully. + */ + 200: ProjectUserDeleteResponse; }; -export type DeleteProjectUserResponse = DeleteProjectUserResponses[keyof DeleteProjectUserResponses]; +export type DeleteProjectUserResponse = + DeleteProjectUserResponses[keyof DeleteProjectUserResponses]; export type RetrieveProjectUserData = { - body?: never; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the user. - */ - user_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/users/{user_id}'; + body?: never; + path: { + /** + * The ID of the project. + */ + project_id: string; + /** + * The ID of the user. + */ + user_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/users/{user_id}'; }; export type RetrieveProjectUserResponses = { - /** - * Project user retrieved successfully. - */ - 200: ProjectUser; + /** + * Project user retrieved successfully. + */ + 200: ProjectUser; }; -export type RetrieveProjectUserResponse = RetrieveProjectUserResponses[keyof RetrieveProjectUserResponses]; +export type RetrieveProjectUserResponse = + RetrieveProjectUserResponses[keyof RetrieveProjectUserResponses]; export type ModifyProjectUserData = { + /** + * The project user update request payload. + */ + body: ProjectUserUpdateRequest; + path: { /** - * The project user update request payload. + * The ID of the project. */ - body: ProjectUserUpdateRequest; - path: { - /** - * The ID of the project. - */ - project_id: string; - /** - * The ID of the user. - */ - user_id: string; - }; - query?: never; - url: '/organization/projects/{project_id}/users/{user_id}'; + project_id: string; + /** + * The ID of the user. + */ + user_id: string; + }; + query?: never; + url: '/organization/projects/{project_id}/users/{user_id}'; }; export type ModifyProjectUserErrors = { - /** - * Error response for various conditions. - */ - 400: ErrorResponse; + /** + * Error response for various conditions. + */ + 400: ErrorResponse; }; export type ModifyProjectUserError = ModifyProjectUserErrors[keyof ModifyProjectUserErrors]; export type ModifyProjectUserResponses = { - /** - * Project user's role updated successfully. - */ - 200: ProjectUser; + /** + * Project user's role updated successfully. + */ + 200: ProjectUser; }; -export type ModifyProjectUserResponse = ModifyProjectUserResponses[keyof ModifyProjectUserResponses]; +export type ModifyProjectUserResponse = + ModifyProjectUserResponses[keyof ModifyProjectUserResponses]; export type UsageAudioSpeechesData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Return only usage for these users. - */ - user_ids?: Array; - /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Return only usage for these models. - */ - models?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/audio_speeches'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Return only usage for these users. + */ + user_ids?: Array; + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + */ + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/audio_speeches'; }; export type UsageAudioSpeechesResponses = { + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; +}; + +export type UsageAudioSpeechesResponse = + UsageAudioSpeechesResponses[keyof UsageAudioSpeechesResponses]; + +export type UsageAudioTranscriptionsData = { + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Return only usage for these users. + */ + user_ids?: Array; + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + */ + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; /** - * Usage data retrieved successfully. + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ - 200: UsageResponse; -}; - -export type UsageAudioSpeechesResponse = UsageAudioSpeechesResponses[keyof UsageAudioSpeechesResponses]; - -export type UsageAudioTranscriptionsData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Return only usage for these users. - */ - user_ids?: Array; - /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Return only usage for these models. - */ - models?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/audio_transcriptions'; + page?: string; + }; + url: '/organization/usage/audio_transcriptions'; }; export type UsageAudioTranscriptionsResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; -export type UsageAudioTranscriptionsResponse = UsageAudioTranscriptionsResponses[keyof UsageAudioTranscriptionsResponses]; +export type UsageAudioTranscriptionsResponse = + UsageAudioTranscriptionsResponses[keyof UsageAudioTranscriptionsResponses]; export type UsageCodeInterpreterSessionsData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`. - */ - group_by?: Array<'project_id'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/code_interpreter_sessions'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`. + */ + group_by?: Array<'project_id'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/code_interpreter_sessions'; }; export type UsageCodeInterpreterSessionsResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; -export type UsageCodeInterpreterSessionsResponse = UsageCodeInterpreterSessionsResponses[keyof UsageCodeInterpreterSessionsResponses]; +export type UsageCodeInterpreterSessionsResponse = + UsageCodeInterpreterSessionsResponses[keyof UsageCodeInterpreterSessionsResponses]; export type UsageCompletionsData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Return only usage for these users. - */ - user_ids?: Array; - /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Return only usage for these models. - */ - models?: Array; - /** - * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. - * - */ - batch?: boolean; - /** - * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `batch` or any combination of them. - */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/completions'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Return only usage for these users. + */ + user_ids?: Array; + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. + * + */ + batch?: boolean; + /** + * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `batch` or any combination of them. + */ + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/completions'; }; export type UsageCompletionsResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; export type UsageCompletionsResponse = UsageCompletionsResponses[keyof UsageCompletionsResponses]; export type UsageEmbeddingsData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Return only usage for these users. - */ - user_ids?: Array; - /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Return only usage for these models. - */ - models?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/embeddings'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Return only usage for these users. + */ + user_ids?: Array; + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + */ + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/embeddings'; }; export type UsageEmbeddingsResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; export type UsageEmbeddingsResponse = UsageEmbeddingsResponses[keyof UsageEmbeddingsResponses]; export type UsageImagesData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them. - */ - sources?: Array<'image.generation' | 'image.edit' | 'image.variation'>; - /** - * Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. - */ - sizes?: Array<'256x256' | '512x512' | '1024x1024' | '1792x1792' | '1024x1792'>; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Return only usage for these users. - */ - user_ids?: Array; - /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Return only usage for these models. - */ - models?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them. - */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'size' | 'source'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/images'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them. + */ + sources?: Array<'image.generation' | 'image.edit' | 'image.variation'>; + /** + * Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. + */ + sizes?: Array<'256x256' | '512x512' | '1024x1024' | '1792x1792' | '1024x1792'>; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Return only usage for these users. + */ + user_ids?: Array; + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model`, `size`, `source` or any combination of them. + */ + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'size' | 'source'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/images'; }; export type UsageImagesResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; export type UsageImagesResponse = UsageImagesResponses[keyof UsageImagesResponses]; export type UsageModerationsData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Return only usage for these users. - */ - user_ids?: Array; - /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Return only usage for these models. - */ - models?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. - */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/moderations'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Return only usage for these users. + */ + user_ids?: Array; + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`, `user_id`, `api_key_id`, `model` or any combination of them. + */ + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/moderations'; }; export type UsageModerationsResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; export type UsageModerationsResponse = UsageModerationsResponses[keyof UsageModerationsResponses]; export type UsageVectorStoresData = { - body?: never; - path?: never; - query: { - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * End time (Unix seconds) of the query time range, exclusive. - */ - end_time?: number; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. - */ - bucket_width?: '1m' | '1h' | '1d'; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Group the usage data by the specified fields. Support fields include `project_id`. - */ - group_by?: Array<'project_id'>; - /** - * Specifies the number of buckets to return. - * - `bucket_width=1d`: default: 7, max: 31 - * - `bucket_width=1h`: default: 24, max: 168 - * - `bucket_width=1m`: default: 60, max: 1440 - * - */ - limit?: number; - /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. - */ - page?: string; - }; - url: '/organization/usage/vector_stores'; + body?: never; + path?: never; + query: { + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Group the usage data by the specified fields. Support fields include `project_id`. + */ + group_by?: Array<'project_id'>; + /** + * Specifies the number of buckets to return. + * - `bucket_width=1d`: default: 7, max: 31 + * - `bucket_width=1h`: default: 24, max: 168 + * - `bucket_width=1m`: default: 60, max: 1440 + * + */ + limit?: number; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + }; + url: '/organization/usage/vector_stores'; }; export type UsageVectorStoresResponses = { - /** - * Usage data retrieved successfully. - */ - 200: UsageResponse; + /** + * Usage data retrieved successfully. + */ + 200: UsageResponse; }; -export type UsageVectorStoresResponse = UsageVectorStoresResponses[keyof UsageVectorStoresResponses]; +export type UsageVectorStoresResponse = + UsageVectorStoresResponses[keyof UsageVectorStoresResponses]; export type ListUsersData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * Filter by the email address of users. - */ - emails?: Array; - }; - url: '/organization/users'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * Filter by the email address of users. + */ + emails?: Array; + }; + url: '/organization/users'; }; export type ListUsersResponses = { - /** - * Users listed successfully. - */ - 200: UserListResponse; + /** + * Users listed successfully. + */ + 200: UserListResponse; }; export type ListUsersResponse = ListUsersResponses[keyof ListUsersResponses]; export type DeleteUserData = { - body?: never; - path: { - /** - * The ID of the user. - */ - user_id: string; - }; - query?: never; - url: '/organization/users/{user_id}'; + body?: never; + path: { + /** + * The ID of the user. + */ + user_id: string; + }; + query?: never; + url: '/organization/users/{user_id}'; }; export type DeleteUserResponses = { - /** - * User deleted successfully. - */ - 200: UserDeleteResponse; + /** + * User deleted successfully. + */ + 200: UserDeleteResponse; }; export type DeleteUserResponse = DeleteUserResponses[keyof DeleteUserResponses]; export type RetrieveUserData = { - body?: never; - path: { - /** - * The ID of the user. - */ - user_id: string; - }; - query?: never; - url: '/organization/users/{user_id}'; + body?: never; + path: { + /** + * The ID of the user. + */ + user_id: string; + }; + query?: never; + url: '/organization/users/{user_id}'; }; export type RetrieveUserResponses = { - /** - * User retrieved successfully. - */ - 200: User; + /** + * User retrieved successfully. + */ + 200: User; }; export type RetrieveUserResponse = RetrieveUserResponses[keyof RetrieveUserResponses]; export type ModifyUserData = { + /** + * The new user role to modify. This must be one of `owner` or `member`. + */ + body: UserRoleUpdateRequest; + path: { /** - * The new user role to modify. This must be one of `owner` or `member`. + * The ID of the user. */ - body: UserRoleUpdateRequest; - path: { - /** - * The ID of the user. - */ - user_id: string; - }; - query?: never; - url: '/organization/users/{user_id}'; + user_id: string; + }; + query?: never; + url: '/organization/users/{user_id}'; }; export type ModifyUserResponses = { - /** - * User role updated successfully. - */ - 200: User; + /** + * User role updated successfully. + */ + 200: User; }; export type ModifyUserResponse = ModifyUserResponses[keyof ModifyUserResponses]; export type CreateRealtimeSessionData = { - /** - * Create an ephemeral API key with the given session configuration. - */ - body: RealtimeSessionCreateRequest; - path?: never; - query?: never; - url: '/realtime/sessions'; + /** + * Create an ephemeral API key with the given session configuration. + */ + body: RealtimeSessionCreateRequest; + path?: never; + query?: never; + url: '/realtime/sessions'; }; export type CreateRealtimeSessionResponses = { - /** - * Session created successfully. - */ - 200: RealtimeSessionCreateResponse; + /** + * Session created successfully. + */ + 200: RealtimeSessionCreateResponse; }; -export type CreateRealtimeSessionResponse = CreateRealtimeSessionResponses[keyof CreateRealtimeSessionResponses]; +export type CreateRealtimeSessionResponse = + CreateRealtimeSessionResponses[keyof CreateRealtimeSessionResponses]; export type CreateRealtimeTranscriptionSessionData = { - /** - * Create an ephemeral API key with the given session configuration. - */ - body: RealtimeTranscriptionSessionCreateRequest; - path?: never; - query?: never; - url: '/realtime/transcription_sessions'; + /** + * Create an ephemeral API key with the given session configuration. + */ + body: RealtimeTranscriptionSessionCreateRequest; + path?: never; + query?: never; + url: '/realtime/transcription_sessions'; }; export type CreateRealtimeTranscriptionSessionResponses = { - /** - * Session created successfully. - */ - 200: RealtimeTranscriptionSessionCreateResponse; + /** + * Session created successfully. + */ + 200: RealtimeTranscriptionSessionCreateResponse; }; -export type CreateRealtimeTranscriptionSessionResponse = CreateRealtimeTranscriptionSessionResponses[keyof CreateRealtimeTranscriptionSessionResponses]; +export type CreateRealtimeTranscriptionSessionResponse = + CreateRealtimeTranscriptionSessionResponses[keyof CreateRealtimeTranscriptionSessionResponses]; export type CreateResponseData = { - body: CreateResponse; - path?: never; - query?: never; - url: '/responses'; + body: CreateResponse; + path?: never; + query?: never; + url: '/responses'; }; export type CreateResponseResponses = { - /** - * OK - */ - 200: Response; + /** + * OK + */ + 200: Response; }; export type CreateResponseResponse = CreateResponseResponses[keyof CreateResponseResponses]; export type DeleteResponseData = { - body?: never; - path: { - /** - * The ID of the response to delete. - */ - response_id: string; - }; - query?: never; - url: '/responses/{response_id}'; + body?: never; + path: { + /** + * The ID of the response to delete. + */ + response_id: string; + }; + query?: never; + url: '/responses/{response_id}'; }; export type DeleteResponseErrors = { - /** - * Not Found - */ - 404: Error; + /** + * Not Found + */ + 404: Error; }; export type DeleteResponseError = DeleteResponseErrors[keyof DeleteResponseErrors]; export type DeleteResponseResponses = { - /** - * OK - */ - 200: unknown; + /** + * OK + */ + 200: unknown; }; export type GetResponseData = { - body?: never; - path: { - /** - * The ID of the response to retrieve. - */ - response_id: string; - }; - query?: { - /** - * Additional fields to include in the response. See the `include` - * parameter for Response creation above for more information. - * - */ - include?: Array; - /** - * If set to true, the model response data will be streamed to the client - * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). - * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) - * for more information. - * - */ - stream?: boolean; - /** - * The sequence number of the event after which to start streaming. - * - */ - starting_after?: number; - /** - * When true, stream obfuscation will be enabled. Stream obfuscation adds - * random characters to an `obfuscation` field on streaming delta events - * to normalize payload sizes as a mitigation to certain side-channel - * attacks. These obfuscation fields are included by default, but add a - * small amount of overhead to the data stream. You can set - * `include_obfuscation` to false to optimize for bandwidth if you trust - * the network links between your application and the OpenAI API. - * - */ - include_obfuscation?: boolean; - }; - url: '/responses/{response_id}'; + body?: never; + path: { + /** + * The ID of the response to retrieve. + */ + response_id: string; + }; + query?: { + /** + * Additional fields to include in the response. See the `include` + * parameter for Response creation above for more information. + * + */ + include?: Array; + /** + * If set to true, the model response data will be streamed to the client + * as it is generated using [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format). + * See the [Streaming section below](https://platform.openai.com/docs/api-reference/responses-streaming) + * for more information. + * + */ + stream?: boolean; + /** + * The sequence number of the event after which to start streaming. + * + */ + starting_after?: number; + /** + * When true, stream obfuscation will be enabled. Stream obfuscation adds + * random characters to an `obfuscation` field on streaming delta events + * to normalize payload sizes as a mitigation to certain side-channel + * attacks. These obfuscation fields are included by default, but add a + * small amount of overhead to the data stream. You can set + * `include_obfuscation` to false to optimize for bandwidth if you trust + * the network links between your application and the OpenAI API. + * + */ + include_obfuscation?: boolean; + }; + url: '/responses/{response_id}'; }; export type GetResponseResponses = { - /** - * OK - */ - 200: Response; + /** + * OK + */ + 200: Response; }; export type GetResponseResponse = GetResponseResponses[keyof GetResponseResponses]; export type CancelResponseData = { - body?: never; - path: { - /** - * The ID of the response to cancel. - */ - response_id: string; - }; - query?: never; - url: '/responses/{response_id}/cancel'; + body?: never; + path: { + /** + * The ID of the response to cancel. + */ + response_id: string; + }; + query?: never; + url: '/responses/{response_id}/cancel'; }; export type CancelResponseErrors = { - /** - * Not Found - */ - 404: Error; + /** + * Not Found + */ + 404: Error; }; export type CancelResponseError = CancelResponseErrors[keyof CancelResponseErrors]; export type CancelResponseResponses = { - /** - * OK - */ - 200: Response; + /** + * OK + */ + 200: Response; }; export type CancelResponseResponse = CancelResponseResponses[keyof CancelResponseResponses]; export type ListInputItemsData = { - body?: never; - path: { - /** - * The ID of the response to retrieve input items for. - */ - response_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between - * 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * The order to return the input items in. Default is `desc`. - * - `asc`: Return the input items in ascending order. - * - `desc`: Return the input items in descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * An item ID to list items after, used in pagination. - * - */ - after?: string; - /** - * An item ID to list items before, used in pagination. - * - */ - before?: string; - /** - * Additional fields to include in the response. See the `include` - * parameter for Response creation above for more information. - * - */ - include?: Array; - }; - url: '/responses/{response_id}/input_items'; + body?: never; + path: { + /** + * The ID of the response to retrieve input items for. + */ + response_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between + * 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * The order to return the input items in. Default is `desc`. + * - `asc`: Return the input items in ascending order. + * - `desc`: Return the input items in descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * An item ID to list items after, used in pagination. + * + */ + after?: string; + /** + * An item ID to list items before, used in pagination. + * + */ + before?: string; + /** + * Additional fields to include in the response. See the `include` + * parameter for Response creation above for more information. + * + */ + include?: Array; + }; + url: '/responses/{response_id}/input_items'; }; export type ListInputItemsResponses = { - /** - * OK - */ - 200: ResponseItemList; + /** + * OK + */ + 200: ResponseItemList; }; export type ListInputItemsResponse = ListInputItemsResponses[keyof ListInputItemsResponses]; export type CreateThreadData = { - body?: CreateThreadRequest; - path?: never; - query?: never; - url: '/threads'; + body?: CreateThreadRequest; + path?: never; + query?: never; + url: '/threads'; }; export type CreateThreadResponses = { - /** - * OK - */ - 200: ThreadObject; + /** + * OK + */ + 200: ThreadObject; }; export type CreateThreadResponse = CreateThreadResponses[keyof CreateThreadResponses]; export type CreateThreadAndRunData = { - body: CreateThreadAndRunRequest; - path?: never; - query?: never; - url: '/threads/runs'; + body: CreateThreadAndRunRequest; + path?: never; + query?: never; + url: '/threads/runs'; }; export type CreateThreadAndRunResponses = { - /** - * OK - */ - 200: RunObject; + /** + * OK + */ + 200: RunObject; }; -export type CreateThreadAndRunResponse = CreateThreadAndRunResponses[keyof CreateThreadAndRunResponses]; +export type CreateThreadAndRunResponse = + CreateThreadAndRunResponses[keyof CreateThreadAndRunResponses]; export type DeleteThreadData = { - body?: never; - path: { - /** - * The ID of the thread to delete. - */ - thread_id: string; - }; - query?: never; - url: '/threads/{thread_id}'; + body?: never; + path: { + /** + * The ID of the thread to delete. + */ + thread_id: string; + }; + query?: never; + url: '/threads/{thread_id}'; }; export type DeleteThreadResponses = { - /** - * OK - */ - 200: DeleteThreadResponse; + /** + * OK + */ + 200: DeleteThreadResponse; }; export type DeleteThreadResponse2 = DeleteThreadResponses[keyof DeleteThreadResponses]; export type GetThreadData = { - body?: never; - path: { - /** - * The ID of the thread to retrieve. - */ - thread_id: string; - }; - query?: never; - url: '/threads/{thread_id}'; + body?: never; + path: { + /** + * The ID of the thread to retrieve. + */ + thread_id: string; + }; + query?: never; + url: '/threads/{thread_id}'; }; export type GetThreadResponses = { - /** - * OK - */ - 200: ThreadObject; + /** + * OK + */ + 200: ThreadObject; }; export type GetThreadResponse = GetThreadResponses[keyof GetThreadResponses]; export type ModifyThreadData = { - body: ModifyThreadRequest; - path: { - /** - * The ID of the thread to modify. Only the `metadata` can be modified. - */ - thread_id: string; - }; - query?: never; - url: '/threads/{thread_id}'; + body: ModifyThreadRequest; + path: { + /** + * The ID of the thread to modify. Only the `metadata` can be modified. + */ + thread_id: string; + }; + query?: never; + url: '/threads/{thread_id}'; }; export type ModifyThreadResponses = { - /** - * OK - */ - 200: ThreadObject; + /** + * OK + */ + 200: ThreadObject; }; export type ModifyThreadResponse = ModifyThreadResponses[keyof ModifyThreadResponses]; export type ListMessagesData = { - body?: never; - path: { - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) the messages belong to. - */ - thread_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - /** - * Filter messages by the run ID that generated them. - * - */ - run_id?: string; - }; - url: '/threads/{thread_id}/messages'; + body?: never; + path: { + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) the messages belong to. + */ + thread_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + /** + * Filter messages by the run ID that generated them. + * + */ + run_id?: string; + }; + url: '/threads/{thread_id}/messages'; }; export type ListMessagesResponses = { - /** - * OK - */ - 200: ListMessagesResponse; + /** + * OK + */ + 200: ListMessagesResponse; }; export type ListMessagesResponse2 = ListMessagesResponses[keyof ListMessagesResponses]; export type CreateMessageData = { - body: CreateMessageRequest; - path: { - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to create a message for. - */ - thread_id: string; - }; - query?: never; - url: '/threads/{thread_id}/messages'; + body: CreateMessageRequest; + path: { + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to create a message for. + */ + thread_id: string; + }; + query?: never; + url: '/threads/{thread_id}/messages'; }; export type CreateMessageResponses = { - /** - * OK - */ - 200: MessageObject; + /** + * OK + */ + 200: MessageObject; }; export type CreateMessageResponse = CreateMessageResponses[keyof CreateMessageResponses]; export type DeleteMessageData = { - body?: never; - path: { - /** - * The ID of the thread to which this message belongs. - */ - thread_id: string; - /** - * The ID of the message to delete. - */ - message_id: string; - }; - query?: never; - url: '/threads/{thread_id}/messages/{message_id}'; + body?: never; + path: { + /** + * The ID of the thread to which this message belongs. + */ + thread_id: string; + /** + * The ID of the message to delete. + */ + message_id: string; + }; + query?: never; + url: '/threads/{thread_id}/messages/{message_id}'; }; export type DeleteMessageResponses = { - /** - * OK - */ - 200: DeleteMessageResponse; + /** + * OK + */ + 200: DeleteMessageResponse; }; export type DeleteMessageResponse2 = DeleteMessageResponses[keyof DeleteMessageResponses]; export type GetMessageData = { - body?: never; - path: { - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this message belongs. - */ - thread_id: string; - /** - * The ID of the message to retrieve. - */ - message_id: string; - }; - query?: never; - url: '/threads/{thread_id}/messages/{message_id}'; + body?: never; + path: { + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this message belongs. + */ + thread_id: string; + /** + * The ID of the message to retrieve. + */ + message_id: string; + }; + query?: never; + url: '/threads/{thread_id}/messages/{message_id}'; }; export type GetMessageResponses = { - /** - * OK - */ - 200: MessageObject; + /** + * OK + */ + 200: MessageObject; }; export type GetMessageResponse = GetMessageResponses[keyof GetMessageResponses]; export type ModifyMessageData = { - body: ModifyMessageRequest; - path: { - /** - * The ID of the thread to which this message belongs. - */ - thread_id: string; - /** - * The ID of the message to modify. - */ - message_id: string; - }; - query?: never; - url: '/threads/{thread_id}/messages/{message_id}'; + body: ModifyMessageRequest; + path: { + /** + * The ID of the thread to which this message belongs. + */ + thread_id: string; + /** + * The ID of the message to modify. + */ + message_id: string; + }; + query?: never; + url: '/threads/{thread_id}/messages/{message_id}'; }; export type ModifyMessageResponses = { - /** - * OK - */ - 200: MessageObject; + /** + * OK + */ + 200: MessageObject; }; export type ModifyMessageResponse = ModifyMessageResponses[keyof ModifyMessageResponses]; export type ListRunsData = { - body?: never; - path: { - /** - * The ID of the thread the run belongs to. - */ - thread_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - }; - url: '/threads/{thread_id}/runs'; + body?: never; + path: { + /** + * The ID of the thread the run belongs to. + */ + thread_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + }; + url: '/threads/{thread_id}/runs'; }; export type ListRunsResponses = { - /** - * OK - */ - 200: ListRunsResponse; + /** + * OK + */ + 200: ListRunsResponse; }; export type ListRunsResponse2 = ListRunsResponses[keyof ListRunsResponses]; export type CreateRunData = { - body: CreateRunRequest; - path: { - /** - * The ID of the thread to run. - */ - thread_id: string; - }; - query?: { - /** - * A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - * - * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - * - */ - 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; - }; - url: '/threads/{thread_id}/runs'; + body: CreateRunRequest; + path: { + /** + * The ID of the thread to run. + */ + thread_id: string; + }; + query?: { + /** + * A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + * + * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + * + */ + 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; + }; + url: '/threads/{thread_id}/runs'; }; export type CreateRunResponses = { - /** - * OK - */ - 200: RunObject; + /** + * OK + */ + 200: RunObject; }; export type CreateRunResponse = CreateRunResponses[keyof CreateRunResponses]; export type GetRunData = { - body?: never; - path: { - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - */ - thread_id: string; - /** - * The ID of the run to retrieve. - */ - run_id: string; - }; - query?: never; - url: '/threads/{thread_id}/runs/{run_id}'; + body?: never; + path: { + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + */ + thread_id: string; + /** + * The ID of the run to retrieve. + */ + run_id: string; + }; + query?: never; + url: '/threads/{thread_id}/runs/{run_id}'; }; export type GetRunResponses = { - /** - * OK - */ - 200: RunObject; + /** + * OK + */ + 200: RunObject; }; export type GetRunResponse = GetRunResponses[keyof GetRunResponses]; export type ModifyRunData = { - body: ModifyRunRequest; - path: { - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. - */ - thread_id: string; - /** - * The ID of the run to modify. - */ - run_id: string; - }; - query?: never; - url: '/threads/{thread_id}/runs/{run_id}'; + body: ModifyRunRequest; + path: { + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + */ + thread_id: string; + /** + * The ID of the run to modify. + */ + run_id: string; + }; + query?: never; + url: '/threads/{thread_id}/runs/{run_id}'; }; export type ModifyRunResponses = { - /** - * OK - */ - 200: RunObject; + /** + * OK + */ + 200: RunObject; }; export type ModifyRunResponse = ModifyRunResponses[keyof ModifyRunResponses]; export type CancelRunData = { - body?: never; - path: { - /** - * The ID of the thread to which this run belongs. - */ - thread_id: string; - /** - * The ID of the run to cancel. - */ - run_id: string; - }; - query?: never; - url: '/threads/{thread_id}/runs/{run_id}/cancel'; + body?: never; + path: { + /** + * The ID of the thread to which this run belongs. + */ + thread_id: string; + /** + * The ID of the run to cancel. + */ + run_id: string; + }; + query?: never; + url: '/threads/{thread_id}/runs/{run_id}/cancel'; }; export type CancelRunResponses = { - /** - * OK - */ - 200: RunObject; + /** + * OK + */ + 200: RunObject; }; export type CancelRunResponse = CancelRunResponses[keyof CancelRunResponses]; export type ListRunStepsData = { - body?: never; - path: { - /** - * The ID of the thread the run and run steps belong to. - */ - thread_id: string; - /** - * The ID of the run the run steps belong to. - */ - run_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - /** - * A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - * - * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - * - */ - 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; - }; - url: '/threads/{thread_id}/runs/{run_id}/steps'; + body?: never; + path: { + /** + * The ID of the thread the run and run steps belong to. + */ + thread_id: string; + /** + * The ID of the run the run steps belong to. + */ + run_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + /** + * A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + * + * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + * + */ + 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; + }; + url: '/threads/{thread_id}/runs/{run_id}/steps'; }; export type ListRunStepsResponses = { - /** - * OK - */ - 200: ListRunStepsResponse; + /** + * OK + */ + 200: ListRunStepsResponse; }; export type ListRunStepsResponse2 = ListRunStepsResponses[keyof ListRunStepsResponses]; export type GetRunStepData = { - body?: never; - path: { - /** - * The ID of the thread to which the run and run step belongs. - */ - thread_id: string; - /** - * The ID of the run to which the run step belongs. - */ - run_id: string; - /** - * The ID of the run step to retrieve. - */ - step_id: string; - }; - query?: { - /** - * A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. - * - * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. - * - */ - 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; - }; - url: '/threads/{thread_id}/runs/{run_id}/steps/{step_id}'; + body?: never; + path: { + /** + * The ID of the thread to which the run and run step belongs. + */ + thread_id: string; + /** + * The ID of the run to which the run step belongs. + */ + run_id: string; + /** + * The ID of the run step to retrieve. + */ + step_id: string; + }; + query?: { + /** + * A list of additional fields to include in the response. Currently the only supported value is `step_details.tool_calls[*].file_search.results[*].content` to fetch the file search result content. + * + * See the [file search tool documentation](https://platform.openai.com/docs/assistants/tools/file-search#customizing-file-search-settings) for more information. + * + */ + 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; + }; + url: '/threads/{thread_id}/runs/{run_id}/steps/{step_id}'; }; export type GetRunStepResponses = { - /** - * OK - */ - 200: RunStepObject; + /** + * OK + */ + 200: RunStepObject; }; export type GetRunStepResponse = GetRunStepResponses[keyof GetRunStepResponses]; export type SubmitToolOuputsToRunData = { - body: SubmitToolOutputsRunRequest; - path: { - /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this run belongs. - */ - thread_id: string; - /** - * The ID of the run that requires the tool output submission. - */ - run_id: string; - }; - query?: never; - url: '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs'; + body: SubmitToolOutputsRunRequest; + path: { + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this run belongs. + */ + thread_id: string; + /** + * The ID of the run that requires the tool output submission. + */ + run_id: string; + }; + query?: never; + url: '/threads/{thread_id}/runs/{run_id}/submit_tool_outputs'; }; export type SubmitToolOuputsToRunResponses = { - /** - * OK - */ - 200: RunObject; + /** + * OK + */ + 200: RunObject; }; -export type SubmitToolOuputsToRunResponse = SubmitToolOuputsToRunResponses[keyof SubmitToolOuputsToRunResponses]; +export type SubmitToolOuputsToRunResponse = + SubmitToolOuputsToRunResponses[keyof SubmitToolOuputsToRunResponses]; export type CreateUploadData = { - body: CreateUploadRequest; - path?: never; - query?: never; - url: '/uploads'; + body: CreateUploadRequest; + path?: never; + query?: never; + url: '/uploads'; }; export type CreateUploadResponses = { - /** - * OK - */ - 200: Upload; + /** + * OK + */ + 200: Upload; }; export type CreateUploadResponse = CreateUploadResponses[keyof CreateUploadResponses]; export type CancelUploadData = { - body?: never; - path: { - /** - * The ID of the Upload. - * - */ - upload_id: string; - }; - query?: never; - url: '/uploads/{upload_id}/cancel'; -}; - -export type CancelUploadResponses = { + body?: never; + path: { /** - * OK + * The ID of the Upload. + * */ - 200: Upload; + upload_id: string; + }; + query?: never; + url: '/uploads/{upload_id}/cancel'; }; -export type CancelUploadResponse = CancelUploadResponses[keyof CancelUploadResponses]; - -export type CompleteUploadData = { - body: CompleteUploadRequest; - path: { - /** - * The ID of the Upload. - * - */ - upload_id: string; - }; - query?: never; - url: '/uploads/{upload_id}/complete'; +export type CancelUploadResponses = { + /** + * OK + */ + 200: Upload; }; -export type CompleteUploadResponses = { +export type CancelUploadResponse = CancelUploadResponses[keyof CancelUploadResponses]; + +export type CompleteUploadData = { + body: CompleteUploadRequest; + path: { /** - * OK + * The ID of the Upload. + * */ - 200: Upload; + upload_id: string; + }; + query?: never; + url: '/uploads/{upload_id}/complete'; +}; + +export type CompleteUploadResponses = { + /** + * OK + */ + 200: Upload; }; export type CompleteUploadResponse = CompleteUploadResponses[keyof CompleteUploadResponses]; export type AddUploadPartData = { - body: AddUploadPartRequest; - path: { - /** - * The ID of the Upload. - * - */ - upload_id: string; - }; - query?: never; - url: '/uploads/{upload_id}/parts'; + body: AddUploadPartRequest; + path: { + /** + * The ID of the Upload. + * + */ + upload_id: string; + }; + query?: never; + url: '/uploads/{upload_id}/parts'; }; export type AddUploadPartResponses = { - /** - * OK - */ - 200: UploadPart; + /** + * OK + */ + 200: UploadPart; }; export type AddUploadPartResponse = AddUploadPartResponses[keyof AddUploadPartResponses]; export type ListVectorStoresData = { - body?: never; - path?: never; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - }; - url: '/vector_stores'; + body?: never; + path?: never; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + }; + url: '/vector_stores'; }; export type ListVectorStoresResponses = { - /** - * OK - */ - 200: ListVectorStoresResponse; + /** + * OK + */ + 200: ListVectorStoresResponse; }; export type ListVectorStoresResponse2 = ListVectorStoresResponses[keyof ListVectorStoresResponses]; export type CreateVectorStoreData = { - body: CreateVectorStoreRequest; - path?: never; - query?: never; - url: '/vector_stores'; + body: CreateVectorStoreRequest; + path?: never; + query?: never; + url: '/vector_stores'; }; export type CreateVectorStoreResponses = { - /** - * OK - */ - 200: VectorStoreObject; + /** + * OK + */ + 200: VectorStoreObject; }; -export type CreateVectorStoreResponse = CreateVectorStoreResponses[keyof CreateVectorStoreResponses]; +export type CreateVectorStoreResponse = + CreateVectorStoreResponses[keyof CreateVectorStoreResponses]; export type DeleteVectorStoreData = { - body?: never; - path: { - /** - * The ID of the vector store to delete. - */ - vector_store_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}'; + body?: never; + path: { + /** + * The ID of the vector store to delete. + */ + vector_store_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}'; }; export type DeleteVectorStoreResponses = { - /** - * OK - */ - 200: DeleteVectorStoreResponse; + /** + * OK + */ + 200: DeleteVectorStoreResponse; }; -export type DeleteVectorStoreResponse2 = DeleteVectorStoreResponses[keyof DeleteVectorStoreResponses]; +export type DeleteVectorStoreResponse2 = + DeleteVectorStoreResponses[keyof DeleteVectorStoreResponses]; export type GetVectorStoreData = { - body?: never; - path: { - /** - * The ID of the vector store to retrieve. - */ - vector_store_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}'; + body?: never; + path: { + /** + * The ID of the vector store to retrieve. + */ + vector_store_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}'; }; export type GetVectorStoreResponses = { - /** - * OK - */ - 200: VectorStoreObject; + /** + * OK + */ + 200: VectorStoreObject; }; export type GetVectorStoreResponse = GetVectorStoreResponses[keyof GetVectorStoreResponses]; export type ModifyVectorStoreData = { - body: UpdateVectorStoreRequest; - path: { - /** - * The ID of the vector store to modify. - */ - vector_store_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}'; + body: UpdateVectorStoreRequest; + path: { + /** + * The ID of the vector store to modify. + */ + vector_store_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}'; }; export type ModifyVectorStoreResponses = { - /** - * OK - */ - 200: VectorStoreObject; + /** + * OK + */ + 200: VectorStoreObject; }; -export type ModifyVectorStoreResponse = ModifyVectorStoreResponses[keyof ModifyVectorStoreResponses]; +export type ModifyVectorStoreResponse = + ModifyVectorStoreResponses[keyof ModifyVectorStoreResponses]; export type CreateVectorStoreFileBatchData = { - body: CreateVectorStoreFileBatchRequest; - path: { - /** - * The ID of the vector store for which to create a File Batch. - * - */ - vector_store_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/file_batches'; + body: CreateVectorStoreFileBatchRequest; + path: { + /** + * The ID of the vector store for which to create a File Batch. + * + */ + vector_store_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/file_batches'; }; export type CreateVectorStoreFileBatchResponses = { - /** - * OK - */ - 200: VectorStoreFileBatchObject; + /** + * OK + */ + 200: VectorStoreFileBatchObject; }; -export type CreateVectorStoreFileBatchResponse = CreateVectorStoreFileBatchResponses[keyof CreateVectorStoreFileBatchResponses]; +export type CreateVectorStoreFileBatchResponse = + CreateVectorStoreFileBatchResponses[keyof CreateVectorStoreFileBatchResponses]; export type GetVectorStoreFileBatchData = { - body?: never; - path: { - /** - * The ID of the vector store that the file batch belongs to. - */ - vector_store_id: string; - /** - * The ID of the file batch being retrieved. - */ - batch_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}'; + body?: never; + path: { + /** + * The ID of the vector store that the file batch belongs to. + */ + vector_store_id: string; + /** + * The ID of the file batch being retrieved. + */ + batch_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}'; }; export type GetVectorStoreFileBatchResponses = { - /** - * OK - */ - 200: VectorStoreFileBatchObject; + /** + * OK + */ + 200: VectorStoreFileBatchObject; }; -export type GetVectorStoreFileBatchResponse = GetVectorStoreFileBatchResponses[keyof GetVectorStoreFileBatchResponses]; +export type GetVectorStoreFileBatchResponse = + GetVectorStoreFileBatchResponses[keyof GetVectorStoreFileBatchResponses]; export type CancelVectorStoreFileBatchData = { - body?: never; - path: { - /** - * The ID of the vector store that the file batch belongs to. - */ - vector_store_id: string; - /** - * The ID of the file batch to cancel. - */ - batch_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel'; + body?: never; + path: { + /** + * The ID of the vector store that the file batch belongs to. + */ + vector_store_id: string; + /** + * The ID of the file batch to cancel. + */ + batch_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/cancel'; }; export type CancelVectorStoreFileBatchResponses = { - /** - * OK - */ - 200: VectorStoreFileBatchObject; + /** + * OK + */ + 200: VectorStoreFileBatchObject; }; -export type CancelVectorStoreFileBatchResponse = CancelVectorStoreFileBatchResponses[keyof CancelVectorStoreFileBatchResponses]; +export type CancelVectorStoreFileBatchResponse = + CancelVectorStoreFileBatchResponses[keyof CancelVectorStoreFileBatchResponses]; export type ListFilesInVectorStoreBatchData = { - body?: never; - path: { - /** - * The ID of the vector store that the files belong to. - */ - vector_store_id: string; - /** - * The ID of the file batch that the files belong to. - */ - batch_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - /** - * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. - */ - filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; - }; - url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files'; + body?: never; + path: { + /** + * The ID of the vector store that the files belong to. + */ + vector_store_id: string; + /** + * The ID of the file batch that the files belong to. + */ + batch_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + /** + * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + */ + filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; + }; + url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files'; }; export type ListFilesInVectorStoreBatchResponses = { - /** - * OK - */ - 200: ListVectorStoreFilesResponse; + /** + * OK + */ + 200: ListVectorStoreFilesResponse; }; -export type ListFilesInVectorStoreBatchResponse = ListFilesInVectorStoreBatchResponses[keyof ListFilesInVectorStoreBatchResponses]; +export type ListFilesInVectorStoreBatchResponse = + ListFilesInVectorStoreBatchResponses[keyof ListFilesInVectorStoreBatchResponses]; export type ListVectorStoreFilesData = { - body?: never; - path: { - /** - * The ID of the vector store that the files belong to. - */ - vector_store_id: string; - }; - query?: { - /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. - * - */ - limit?: number; - /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. - * - */ - order?: 'asc' | 'desc'; - /** - * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. - * - */ - after?: string; - /** - * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. - * - */ - before?: string; - /** - * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. - */ - filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; - }; - url: '/vector_stores/{vector_store_id}/files'; + body?: never; + path: { + /** + * The ID of the vector store that the files belong to. + */ + vector_store_id: string; + }; + query?: { + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + /** + * A cursor for use in pagination. `after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with obj_foo, your subsequent call can include after=obj_foo in order to fetch the next page of the list. + * + */ + after?: string; + /** + * A cursor for use in pagination. `before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with obj_foo, your subsequent call can include before=obj_foo in order to fetch the previous page of the list. + * + */ + before?: string; + /** + * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. + */ + filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; + }; + url: '/vector_stores/{vector_store_id}/files'; }; export type ListVectorStoreFilesResponses = { - /** - * OK - */ - 200: ListVectorStoreFilesResponse; + /** + * OK + */ + 200: ListVectorStoreFilesResponse; }; -export type ListVectorStoreFilesResponse2 = ListVectorStoreFilesResponses[keyof ListVectorStoreFilesResponses]; +export type ListVectorStoreFilesResponse2 = + ListVectorStoreFilesResponses[keyof ListVectorStoreFilesResponses]; export type CreateVectorStoreFileData = { - body: CreateVectorStoreFileRequest; - path: { - /** - * The ID of the vector store for which to create a File. - * - */ - vector_store_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/files'; + body: CreateVectorStoreFileRequest; + path: { + /** + * The ID of the vector store for which to create a File. + * + */ + vector_store_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/files'; }; export type CreateVectorStoreFileResponses = { - /** - * OK - */ - 200: VectorStoreFileObject; + /** + * OK + */ + 200: VectorStoreFileObject; }; -export type CreateVectorStoreFileResponse = CreateVectorStoreFileResponses[keyof CreateVectorStoreFileResponses]; +export type CreateVectorStoreFileResponse = + CreateVectorStoreFileResponses[keyof CreateVectorStoreFileResponses]; export type DeleteVectorStoreFileData = { - body?: never; - path: { - /** - * The ID of the vector store that the file belongs to. - */ - vector_store_id: string; - /** - * The ID of the file to delete. - */ - file_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/files/{file_id}'; + body?: never; + path: { + /** + * The ID of the vector store that the file belongs to. + */ + vector_store_id: string; + /** + * The ID of the file to delete. + */ + file_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/files/{file_id}'; }; export type DeleteVectorStoreFileResponses = { - /** - * OK - */ - 200: DeleteVectorStoreFileResponse; + /** + * OK + */ + 200: DeleteVectorStoreFileResponse; }; -export type DeleteVectorStoreFileResponse2 = DeleteVectorStoreFileResponses[keyof DeleteVectorStoreFileResponses]; +export type DeleteVectorStoreFileResponse2 = + DeleteVectorStoreFileResponses[keyof DeleteVectorStoreFileResponses]; export type GetVectorStoreFileData = { - body?: never; - path: { - /** - * The ID of the vector store that the file belongs to. - */ - vector_store_id: string; - /** - * The ID of the file being retrieved. - */ - file_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/files/{file_id}'; + body?: never; + path: { + /** + * The ID of the vector store that the file belongs to. + */ + vector_store_id: string; + /** + * The ID of the file being retrieved. + */ + file_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/files/{file_id}'; }; export type GetVectorStoreFileResponses = { - /** - * OK - */ - 200: VectorStoreFileObject; + /** + * OK + */ + 200: VectorStoreFileObject; }; -export type GetVectorStoreFileResponse = GetVectorStoreFileResponses[keyof GetVectorStoreFileResponses]; +export type GetVectorStoreFileResponse = + GetVectorStoreFileResponses[keyof GetVectorStoreFileResponses]; export type UpdateVectorStoreFileAttributesData = { - body: UpdateVectorStoreFileAttributesRequest; - path: { - /** - * The ID of the vector store the file belongs to. - */ - vector_store_id: string; - /** - * The ID of the file to update attributes. - */ - file_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/files/{file_id}'; + body: UpdateVectorStoreFileAttributesRequest; + path: { + /** + * The ID of the vector store the file belongs to. + */ + vector_store_id: string; + /** + * The ID of the file to update attributes. + */ + file_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/files/{file_id}'; }; export type UpdateVectorStoreFileAttributesResponses = { - /** - * OK - */ - 200: VectorStoreFileObject; + /** + * OK + */ + 200: VectorStoreFileObject; }; -export type UpdateVectorStoreFileAttributesResponse = UpdateVectorStoreFileAttributesResponses[keyof UpdateVectorStoreFileAttributesResponses]; +export type UpdateVectorStoreFileAttributesResponse = + UpdateVectorStoreFileAttributesResponses[keyof UpdateVectorStoreFileAttributesResponses]; export type RetrieveVectorStoreFileContentData = { - body?: never; - path: { - /** - * The ID of the vector store. - */ - vector_store_id: string; - /** - * The ID of the file within the vector store. - */ - file_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/files/{file_id}/content'; + body?: never; + path: { + /** + * The ID of the vector store. + */ + vector_store_id: string; + /** + * The ID of the file within the vector store. + */ + file_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/files/{file_id}/content'; }; export type RetrieveVectorStoreFileContentResponses = { - /** - * OK - */ - 200: VectorStoreFileContentResponse; + /** + * OK + */ + 200: VectorStoreFileContentResponse; }; -export type RetrieveVectorStoreFileContentResponse = RetrieveVectorStoreFileContentResponses[keyof RetrieveVectorStoreFileContentResponses]; +export type RetrieveVectorStoreFileContentResponse = + RetrieveVectorStoreFileContentResponses[keyof RetrieveVectorStoreFileContentResponses]; export type SearchVectorStoreData = { - body: VectorStoreSearchRequest; - path: { - /** - * The ID of the vector store to search. - */ - vector_store_id: string; - }; - query?: never; - url: '/vector_stores/{vector_store_id}/search'; + body: VectorStoreSearchRequest; + path: { + /** + * The ID of the vector store to search. + */ + vector_store_id: string; + }; + query?: never; + url: '/vector_stores/{vector_store_id}/search'; }; export type SearchVectorStoreResponses = { - /** - * OK - */ - 200: VectorStoreSearchResultsPage; + /** + * OK + */ + 200: VectorStoreSearchResultsPage; }; -export type SearchVectorStoreResponse = SearchVectorStoreResponses[keyof SearchVectorStoreResponses]; +export type SearchVectorStoreResponse = + SearchVectorStoreResponses[keyof SearchVectorStoreResponses]; /** * The event payload sent by the API. @@ -22457,10 +23129,10 @@ export type SearchVectorStoreResponse = SearchVectorStoreResponses[keyof SearchV export type PostBatchCancelledWebhookPayload = WebhookBatchCancelled; export type PostBatchCancelledWebhookRequest = { - body: PostBatchCancelledWebhookPayload; - key: 'batch_cancelled'; - path?: never; - query?: never; + body: PostBatchCancelledWebhookPayload; + key: 'batch_cancelled'; + path?: never; + query?: never; }; /** @@ -22469,10 +23141,10 @@ export type PostBatchCancelledWebhookRequest = { export type PostBatchCompletedWebhookPayload = WebhookBatchCompleted; export type PostBatchCompletedWebhookRequest = { - body: PostBatchCompletedWebhookPayload; - key: 'batch_completed'; - path?: never; - query?: never; + body: PostBatchCompletedWebhookPayload; + key: 'batch_completed'; + path?: never; + query?: never; }; /** @@ -22481,10 +23153,10 @@ export type PostBatchCompletedWebhookRequest = { export type PostBatchExpiredWebhookPayload = WebhookBatchExpired; export type PostBatchExpiredWebhookRequest = { - body: PostBatchExpiredWebhookPayload; - key: 'batch_expired'; - path?: never; - query?: never; + body: PostBatchExpiredWebhookPayload; + key: 'batch_expired'; + path?: never; + query?: never; }; /** @@ -22493,10 +23165,10 @@ export type PostBatchExpiredWebhookRequest = { export type PostBatchFailedWebhookPayload = WebhookBatchFailed; export type PostBatchFailedWebhookRequest = { - body: PostBatchFailedWebhookPayload; - key: 'batch_failed'; - path?: never; - query?: never; + body: PostBatchFailedWebhookPayload; + key: 'batch_failed'; + path?: never; + query?: never; }; /** @@ -22505,10 +23177,10 @@ export type PostBatchFailedWebhookRequest = { export type PostEvalRunCanceledWebhookPayload = WebhookEvalRunCanceled; export type PostEvalRunCanceledWebhookRequest = { - body: PostEvalRunCanceledWebhookPayload; - key: 'eval_run_canceled'; - path?: never; - query?: never; + body: PostEvalRunCanceledWebhookPayload; + key: 'eval_run_canceled'; + path?: never; + query?: never; }; /** @@ -22517,10 +23189,10 @@ export type PostEvalRunCanceledWebhookRequest = { export type PostEvalRunFailedWebhookPayload = WebhookEvalRunFailed; export type PostEvalRunFailedWebhookRequest = { - body: PostEvalRunFailedWebhookPayload; - key: 'eval_run_failed'; - path?: never; - query?: never; + body: PostEvalRunFailedWebhookPayload; + key: 'eval_run_failed'; + path?: never; + query?: never; }; /** @@ -22529,10 +23201,10 @@ export type PostEvalRunFailedWebhookRequest = { export type PostEvalRunSucceededWebhookPayload = WebhookEvalRunSucceeded; export type PostEvalRunSucceededWebhookRequest = { - body: PostEvalRunSucceededWebhookPayload; - key: 'eval_run_succeeded'; - path?: never; - query?: never; + body: PostEvalRunSucceededWebhookPayload; + key: 'eval_run_succeeded'; + path?: never; + query?: never; }; /** @@ -22541,10 +23213,10 @@ export type PostEvalRunSucceededWebhookRequest = { export type PostFineTuningJobCancelledWebhookPayload = WebhookFineTuningJobCancelled; export type PostFineTuningJobCancelledWebhookRequest = { - body: PostFineTuningJobCancelledWebhookPayload; - key: 'fine_tuning_job_cancelled'; - path?: never; - query?: never; + body: PostFineTuningJobCancelledWebhookPayload; + key: 'fine_tuning_job_cancelled'; + path?: never; + query?: never; }; /** @@ -22553,10 +23225,10 @@ export type PostFineTuningJobCancelledWebhookRequest = { export type PostFineTuningJobFailedWebhookPayload = WebhookFineTuningJobFailed; export type PostFineTuningJobFailedWebhookRequest = { - body: PostFineTuningJobFailedWebhookPayload; - key: 'fine_tuning_job_failed'; - path?: never; - query?: never; + body: PostFineTuningJobFailedWebhookPayload; + key: 'fine_tuning_job_failed'; + path?: never; + query?: never; }; /** @@ -22565,10 +23237,10 @@ export type PostFineTuningJobFailedWebhookRequest = { export type PostFineTuningJobSucceededWebhookPayload = WebhookFineTuningJobSucceeded; export type PostFineTuningJobSucceededWebhookRequest = { - body: PostFineTuningJobSucceededWebhookPayload; - key: 'fine_tuning_job_succeeded'; - path?: never; - query?: never; + body: PostFineTuningJobSucceededWebhookPayload; + key: 'fine_tuning_job_succeeded'; + path?: never; + query?: never; }; /** @@ -22577,10 +23249,10 @@ export type PostFineTuningJobSucceededWebhookRequest = { export type PostResponseCancelledWebhookPayload = WebhookResponseCancelled; export type PostResponseCancelledWebhookRequest = { - body: PostResponseCancelledWebhookPayload; - key: 'response_cancelled'; - path?: never; - query?: never; + body: PostResponseCancelledWebhookPayload; + key: 'response_cancelled'; + path?: never; + query?: never; }; /** @@ -22589,10 +23261,10 @@ export type PostResponseCancelledWebhookRequest = { export type PostResponseCompletedWebhookPayload = WebhookResponseCompleted; export type PostResponseCompletedWebhookRequest = { - body: PostResponseCompletedWebhookPayload; - key: 'response_completed'; - path?: never; - query?: never; + body: PostResponseCompletedWebhookPayload; + key: 'response_completed'; + path?: never; + query?: never; }; /** @@ -22601,10 +23273,10 @@ export type PostResponseCompletedWebhookRequest = { export type PostResponseFailedWebhookPayload = WebhookResponseFailed; export type PostResponseFailedWebhookRequest = { - body: PostResponseFailedWebhookPayload; - key: 'response_failed'; - path?: never; - query?: never; + body: PostResponseFailedWebhookPayload; + key: 'response_failed'; + path?: never; + query?: never; }; /** @@ -22613,8 +23285,8 @@ export type PostResponseFailedWebhookRequest = { export type PostResponseIncompleteWebhookPayload = WebhookResponseIncomplete; export type PostResponseIncompleteWebhookRequest = { - body: PostResponseIncompleteWebhookPayload; - key: 'response_incomplete'; - path?: never; - query?: never; + body: PostResponseIncompleteWebhookPayload; + key: 'response_incomplete'; + path?: never; + query?: never; }; diff --git a/examples/openapi-ts-pinia-colada/.eslintrc.cjs b/examples/openapi-ts-pinia-colada/.eslintrc.cjs index fc7c44e7f9..f319f3ed89 100644 --- a/examples/openapi-ts-pinia-colada/.eslintrc.cjs +++ b/examples/openapi-ts-pinia-colada/.eslintrc.cjs @@ -1,4 +1,3 @@ -/* eslint-env node */ require('@rushstack/eslint-patch/modern-module-resolution'); module.exports = { diff --git a/examples/openapi-ts-pinia-colada/src/client/schemas.gen.ts b/examples/openapi-ts-pinia-colada/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-pinia-colada/src/client/schemas.gen.ts +++ b/examples/openapi-ts-pinia-colada/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-pinia-colada/src/client/types.gen.ts b/examples/openapi-ts-pinia-colada/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-pinia-colada/src/client/types.gen.ts +++ b/examples/openapi-ts-pinia-colada/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/schemas.gen.ts b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/schemas.gen.ts +++ b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/types.gen.ts b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-tanstack-angular-query-experimental/src/client/types.gen.ts +++ b/examples/openapi-ts-tanstack-angular-query-experimental/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-tanstack-react-query/src/client/schemas.gen.ts b/examples/openapi-ts-tanstack-react-query/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-tanstack-react-query/src/client/schemas.gen.ts +++ b/examples/openapi-ts-tanstack-react-query/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-tanstack-react-query/src/client/types.gen.ts b/examples/openapi-ts-tanstack-react-query/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-tanstack-react-query/src/client/types.gen.ts +++ b/examples/openapi-ts-tanstack-react-query/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-tanstack-svelte-query/src/client/schemas.gen.ts b/examples/openapi-ts-tanstack-svelte-query/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-tanstack-svelte-query/src/client/schemas.gen.ts +++ b/examples/openapi-ts-tanstack-svelte-query/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-tanstack-svelte-query/src/client/types.gen.ts b/examples/openapi-ts-tanstack-svelte-query/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-tanstack-svelte-query/src/client/types.gen.ts +++ b/examples/openapi-ts-tanstack-svelte-query/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/examples/openapi-ts-tanstack-vue-query/.eslintrc.cjs b/examples/openapi-ts-tanstack-vue-query/.eslintrc.cjs index fc7c44e7f9..f319f3ed89 100644 --- a/examples/openapi-ts-tanstack-vue-query/.eslintrc.cjs +++ b/examples/openapi-ts-tanstack-vue-query/.eslintrc.cjs @@ -1,4 +1,3 @@ -/* eslint-env node */ require('@rushstack/eslint-patch/modern-module-resolution'); module.exports = { diff --git a/examples/openapi-ts-tanstack-vue-query/src/client/schemas.gen.ts b/examples/openapi-ts-tanstack-vue-query/src/client/schemas.gen.ts index 646632e830..3f7c003814 100644 --- a/examples/openapi-ts-tanstack-vue-query/src/client/schemas.gen.ts +++ b/examples/openapi-ts-tanstack-vue-query/src/client/schemas.gen.ts @@ -1,187 +1,187 @@ // This file is auto-generated by @hey-api/openapi-ts export const OrderSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Order', + type: 'object', properties: { - complete: { - type: 'boolean', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, petId: { - example: 198772, - format: 'int64', type: 'integer', + format: 'int64', + example: 198772, }, quantity: { - example: 7, - format: 'int32', type: 'integer', + format: 'int32', + example: 7, }, shipDate: { - format: 'date-time', type: 'string', + format: 'date-time', }, status: { + type: 'string', description: 'Order Status', - enum: ['placed', 'approved', 'delivered'], example: 'approved', - type: 'string', + enum: ['placed', 'approved', 'delivered'], + }, + complete: { + type: 'boolean', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Order', xml: { name: 'order', }, } as const; export const CategorySchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Category', + type: 'object', properties: { id: { - example: 1, - format: 'int64', type: 'integer', + format: 'int64', + example: 1, }, name: { - example: 'Dogs', type: 'string', + example: 'Dogs', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Category', xml: { name: 'category', }, } as const; export const UserSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.User', + type: 'object', properties: { - email: { - example: 'john@email.com', + id: { + type: 'integer', + format: 'int64', + example: 10, + }, + username: { type: 'string', + example: 'theUser', }, firstName: { - example: 'John', type: 'string', - }, - id: { - example: 10, - format: 'int64', - type: 'integer', + example: 'John', }, lastName: { + type: 'string', example: 'James', + }, + email: { type: 'string', + example: 'john@email.com', }, password: { - example: '12345', type: 'string', + example: '12345', }, phone: { - example: '12345', type: 'string', + example: '12345', }, userStatus: { + type: 'integer', description: 'User Status', - example: 1, format: 'int32', - type: 'integer', - }, - username: { - example: 'theUser', - type: 'string', + example: 1, }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.User', xml: { name: 'user', }, } as const; export const TagSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', + type: 'object', properties: { id: { - format: 'int64', type: 'integer', + format: 'int64', }, name: { type: 'string', }, }, - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Tag', xml: { name: 'tag', }, } as const; export const PetSchema = { + 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', + required: ['name', 'photoUrls'], + type: 'object', properties: { - category: { - $ref: '#/components/schemas/Category', - }, id: { - example: 10, - format: 'int64', type: 'integer', + format: 'int64', + example: 10, }, name: { - example: 'doggie', type: 'string', + example: 'doggie', + }, + category: { + $ref: '#/components/schemas/Category', }, photoUrls: { + type: 'array', + xml: { + wrapped: true, + }, items: { type: 'string', xml: { name: 'photoUrl', }, }, + }, + tags: { type: 'array', xml: { wrapped: true, }, + items: { + $ref: '#/components/schemas/Tag', + }, }, status: { + type: 'string', description: 'pet status in the store', enum: ['available', 'pending', 'sold'], - type: 'string', - }, - tags: { - items: { - $ref: '#/components/schemas/Tag', - }, - type: 'array', - xml: { - wrapped: true, - }, }, }, - required: ['name', 'photoUrls'], - type: 'object', - 'x-swagger-router-model': 'io.swagger.petstore.model.Pet', xml: { name: 'pet', }, } as const; export const ApiResponseSchema = { + type: 'object', properties: { code: { - format: 'int32', type: 'integer', + format: 'int32', }, - message: { + type: { type: 'string', }, - type: { + message: { type: 'string', }, }, - type: 'object', xml: { name: '##default', }, diff --git a/examples/openapi-ts-tanstack-vue-query/src/client/types.gen.ts b/examples/openapi-ts-tanstack-vue-query/src/client/types.gen.ts index a8ea86379a..201f5c125a 100644 --- a/examples/openapi-ts-tanstack-vue-query/src/client/types.gen.ts +++ b/examples/openapi-ts-tanstack-vue-query/src/client/types.gen.ts @@ -5,7 +5,6 @@ export type ClientOptions = { }; export type Order = { - complete?: boolean; id?: number; petId?: number; quantity?: number; @@ -14,6 +13,7 @@ export type Order = { * Order Status */ status?: 'placed' | 'approved' | 'delivered'; + complete?: boolean; }; export type Category = { @@ -22,17 +22,17 @@ export type Category = { }; export type User = { - email?: string; - firstName?: string; id?: number; + username?: string; + firstName?: string; lastName?: string; + email?: string; password?: string; phone?: string; /** * User Status */ userStatus?: number; - username?: string; }; export type Tag = { @@ -41,21 +41,21 @@ export type Tag = { }; export type Pet = { - category?: Category; id?: number; name: string; + category?: Category; photoUrls: Array; + tags?: Array; /** * pet status in the store */ status?: 'available' | 'pending' | 'sold'; - tags?: Array; }; export type ApiResponse = { code?: number; - message?: string; type?: string; + message?: string; }; export type Pet2 = Pet; @@ -533,14 +533,14 @@ export type LoginUserData = { body?: never; path?: never; query?: { - /** - * The password for login in clear text - */ - password?: string; /** * The user name for login */ username?: string; + /** + * The password for login in clear text + */ + password?: string; }; url: '/user/login'; }; diff --git a/packages/shared/src/config/output/__tests__/postprocess.test.ts b/packages/shared/src/config/output/__tests__/postprocess.test.ts new file mode 100644 index 0000000000..9577f46b9e --- /dev/null +++ b/packages/shared/src/config/output/__tests__/postprocess.test.ts @@ -0,0 +1,214 @@ +import fs from 'node:fs'; + +import { sync } from 'cross-spawn'; +import { vi } from 'vitest'; + +import { ConfigError } from '../../../error'; +import { postprocessOutput } from '../postprocess'; + +vi.mock('cross-spawn'); +vi.mock('node:fs'); + +const mockSync = vi.mocked(sync); +const mockExistsSync = vi.mocked(fs.existsSync); +const mockReaddirSync = vi.mocked(fs.readdirSync); + +const baseConfig = { + path: '/output', + postProcess: [], +}; + +const noopPostProcessors = {}; + +describe('postprocessOutput', () => { + beforeEach(() => { + vi.clearAllMocks(); + mockExistsSync.mockReturnValue(true); + mockReaddirSync.mockReturnValue(['index.ts'] as any); + }); + + it('should not call sync when postProcess is empty', () => { + postprocessOutput(baseConfig, noopPostProcessors, ''); + expect(mockSync).not.toHaveBeenCalled(); + }); + + it('should not call sync when output directory does not exist', () => { + mockExistsSync.mockReturnValue(false); + + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ); + + expect(mockSync).not.toHaveBeenCalled(); + }); + + it('should not call sync when output directory is empty', () => { + mockReaddirSync.mockReturnValue([] as any); + + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ); + + expect(mockSync).not.toHaveBeenCalled(); + }); + + it('should call sync with command and resolved args', () => { + mockSync.mockReturnValue({ error: undefined, status: 0 } as any); + + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['fmt', '{{path}}'], command: 'dprint' }] }, + noopPostProcessors, + '', + ); + + expect(mockSync).toHaveBeenCalledWith('dprint', ['fmt', '/output']); + }); + + it('should replace {{path}} placeholder in args', () => { + mockSync.mockReturnValue({ error: undefined, status: 0 } as any); + + postprocessOutput( + { path: '/my/output', postProcess: [{ args: ['{{path}}', '--write'], command: 'prettier' }] }, + noopPostProcessors, + '', + ); + + expect(mockSync).toHaveBeenCalledWith('prettier', ['/my/output', '--write']); + }); + + it('should throw ConfigError when the process fails to spawn (e.g., ENOENT)', () => { + const spawnError = new Error('spawnSync oxfmt ENOENT'); + mockSync.mockReturnValue({ error: spawnError, status: null } as any); + + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'oxfmt' }] }, + noopPostProcessors, + '', + ), + ).toThrow(ConfigError); + }); + + it('should include the error message when the process fails to spawn', () => { + const spawnError = new Error('spawnSync oxfmt ENOENT'); + mockSync.mockReturnValue({ error: spawnError, status: null } as any); + + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'oxfmt' }] }, + noopPostProcessors, + '', + ), + ).toThrow('Post-processor "oxfmt" failed to run: spawnSync oxfmt ENOENT'); + }); + + it('should throw with a custom name when the process fails to spawn', () => { + const spawnError = new Error('spawnSync my-formatter ENOENT'); + mockSync.mockReturnValue({ error: spawnError, status: null } as any); + + expect(() => + postprocessOutput( + { + ...baseConfig, + postProcess: [{ args: ['{{path}}'], command: 'my-formatter', name: 'My Formatter' }], + }, + noopPostProcessors, + '', + ), + ).toThrow('Post-processor "My Formatter" failed to run: spawnSync my-formatter ENOENT'); + }); + + it('should throw ConfigError when the process exits with a non-zero status code', () => { + mockSync.mockReturnValue({ error: undefined, status: 1, stderr: Buffer.from('') } as any); + + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ), + ).toThrow(ConfigError); + }); + + it('should include exit code in error message', () => { + mockSync.mockReturnValue({ error: undefined, status: 1, stderr: Buffer.from('') } as any); + + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ), + ).toThrow('Post-processor "prettier" exited with code 1'); + }); + + it('should include stderr output in error message when process fails', () => { + mockSync.mockReturnValue({ + error: undefined, + status: 2, + stderr: Buffer.from('error: file not found'), + } as any); + + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'biome' }] }, + noopPostProcessors, + '', + ), + ).toThrow('Post-processor "biome" exited with code 2:\nerror: file not found'); + }); + + it('should not throw when the process is killed by a signal (null status)', () => { + mockSync.mockReturnValue({ error: undefined, signal: 'SIGTERM', status: null } as any); + + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ), + ).not.toThrow(); + }); + + it('should skip unknown string preset processors', () => { + postprocessOutput({ ...baseConfig, postProcess: ['unknown-preset'] }, noopPostProcessors, ''); + expect(mockSync).not.toHaveBeenCalled(); + }); + + it('should resolve and run string preset processors', () => { + mockSync.mockReturnValue({ error: undefined, status: 0 } as any); + + const processors = { + prettier: { args: ['--write', '{{path}}'], command: 'prettier', name: 'Prettier' }, + }; + + postprocessOutput({ ...baseConfig, postProcess: ['prettier'] }, processors, ''); + + expect(mockSync).toHaveBeenCalledWith('prettier', ['--write', '/output']); + }); + + it('should stop processing and throw on first failure', () => { + const spawnError = new Error('ENOENT'); + mockSync.mockReturnValue({ error: spawnError, status: null } as any); + + expect(() => + postprocessOutput( + { + ...baseConfig, + postProcess: [ + { args: ['{{path}}'], command: 'first' }, + { args: ['{{path}}'], command: 'second' }, + ], + }, + noopPostProcessors, + '', + ), + ).toThrow('Post-processor "first" failed to run: ENOENT'); + + expect(mockSync).toHaveBeenCalledTimes(1); + }); +}); diff --git a/packages/shared/src/config/output/postprocess.ts b/packages/shared/src/config/output/postprocess.ts index e2c3ac26be..a54f324f19 100644 --- a/packages/shared/src/config/output/postprocess.ts +++ b/packages/shared/src/config/output/postprocess.ts @@ -1,6 +1,10 @@ +import fs from 'node:fs'; + import colors from 'ansi-colors'; import { sync } from 'cross-spawn'; +import { ConfigError } from '../../error'; + type Output = { /** * The absolute path to the output folder. @@ -50,6 +54,10 @@ export function postprocessOutput( postProcessors: Record, jobPrefix: string, ): void { + if (!fs.existsSync(config.path) || fs.readdirSync(config.path).length === 0) { + return; + } + for (const processor of config.postProcess) { const resolved = typeof processor === 'string' ? postProcessors[processor] : processor; @@ -60,6 +68,19 @@ export function postprocessOutput( const args = resolved.args.map((arg) => arg.replace('{{path}}', config.path)); console.log(`${jobPrefix}🧹 Running ${colors.cyanBright(name)}`); - sync(resolved.command, args); + const result = sync(resolved.command, args); + + if (result.error) { + throw new ConfigError(`Post-processor "${name}" failed to run: ${result.error.message}`); + } + + if (result.status !== null && result.status !== 0) { + let message = `Post-processor "${name}" exited with code ${result.status}`; + const stderr = result.stderr?.toString().trim(); + if (stderr) { + message += `:\n${stderr}`; + } + throw new ConfigError(message); + } } }