From b395f943db9ae7fbf40abcd392cd40bf5eef7ec7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 13:19:38 +0000 Subject: [PATCH 01/10] Initial plan From ebe6f936c4e34551700af58586af8d551385c300 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 13:25:52 +0000 Subject: [PATCH 02/10] fix: surface output.postProcess execution errors instead of swallowing them Agent-Logs-Url: https://github.com/hey-api/openapi-ts/sessions/d85588ef-7ad9-4ab7-a857-fbbe719b294f --- .../output/__tests__/postprocess.test.ts | 145 ++++++++++++++++++ .../shared/src/config/output/postprocess.ts | 14 +- 2 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 packages/shared/src/config/output/__tests__/postprocess.test.ts 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..f913dd9b1b --- /dev/null +++ b/packages/shared/src/config/output/__tests__/postprocess.test.ts @@ -0,0 +1,145 @@ +import { sync } from 'cross-spawn'; +import { vi } from 'vitest'; + +import { postprocessOutput } from '../postprocess'; + +vi.mock('cross-spawn'); + +const mockSync = vi.mocked(sync); + +const baseConfig = { + path: '/output', + postProcess: [], +}; + +const noopPostProcessors = {}; + +describe('postprocessOutput', () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + it('should not call sync when postProcess is empty', () => { + postprocessOutput(baseConfig, 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 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('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 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('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 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..bd5f8c8f70 100644 --- a/packages/shared/src/config/output/postprocess.ts +++ b/packages/shared/src/config/output/postprocess.ts @@ -60,6 +60,18 @@ 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 Error(`Post-processor "${name}" failed to run: ${result.error.message}`); + } + + if (result.status !== 0) { + const stderr = result.stderr?.toString().trim(); + const message = stderr + ? `Post-processor "${name}" exited with code ${result.status}:\n${stderr}` + : `Post-processor "${name}" exited with code ${result.status}`; + throw new Error(message); + } } } From ca7fbd80ece310b4fa8b20c5d1dd54aa978fbfa8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Apr 2026 15:29:02 +0000 Subject: [PATCH 03/10] fix: avoid duplicating error message string using let in postprocessOutput Agent-Logs-Url: https://github.com/hey-api/openapi-ts/sessions/f7a80408-cf1a-4b31-9fdf-1881e5f8dc6f --- packages/shared/src/config/output/postprocess.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/shared/src/config/output/postprocess.ts b/packages/shared/src/config/output/postprocess.ts index bd5f8c8f70..b25ef14caa 100644 --- a/packages/shared/src/config/output/postprocess.ts +++ b/packages/shared/src/config/output/postprocess.ts @@ -67,10 +67,11 @@ export function postprocessOutput( } if (result.status !== 0) { + let message = `Post-processor "${name}" exited with code ${result.status}`; const stderr = result.stderr?.toString().trim(); - const message = stderr - ? `Post-processor "${name}" exited with code ${result.status}:\n${stderr}` - : `Post-processor "${name}" exited with code ${result.status}`; + if (stderr) { + message += `:\n${stderr}`; + } throw new Error(message); } } From e69d79f0d7de8a0a2f955457a522b88f505ae80d Mon Sep 17 00:00:00 2001 From: Lubos Date: Fri, 3 Apr 2026 17:50:46 +0200 Subject: [PATCH 04/10] Update changeset to fix postprocess error handling Fixes issues related to surfacing postprocess errors in the output. --- .changeset/shaggy-games-appear.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/shaggy-games-appear.md 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 From ef151a0718c363f385c1656d4ef90166d8a4ce0c Mon Sep 17 00:00:00 2001 From: "pullfrog[bot]" <226033991+pullfrog[bot]@users.noreply.github.com> Date: Fri, 3 Apr 2026 18:33:54 +0000 Subject: [PATCH 05/10] fix: use ConfigError, guard null status, skip empty output dirs --- .../output/__tests__/postprocess.test.ts | 73 ++++++++++++++++++- .../shared/src/config/output/postprocess.ts | 19 ++++- 2 files changed, 87 insertions(+), 5 deletions(-) diff --git a/packages/shared/src/config/output/__tests__/postprocess.test.ts b/packages/shared/src/config/output/__tests__/postprocess.test.ts index f913dd9b1b..9577f46b9e 100644 --- a/packages/shared/src/config/output/__tests__/postprocess.test.ts +++ b/packages/shared/src/config/output/__tests__/postprocess.test.ts @@ -1,11 +1,17 @@ +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', @@ -17,6 +23,8 @@ 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', () => { @@ -24,6 +32,30 @@ describe('postprocessOutput', () => { 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); @@ -48,7 +80,20 @@ describe('postprocessOutput', () => { expect(mockSync).toHaveBeenCalledWith('prettier', ['/my/output', '--write']); }); - it('should throw when the process fails to spawn (e.g., ENOENT)', () => { + 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); @@ -77,7 +122,19 @@ describe('postprocessOutput', () => { ).toThrow('Post-processor "My Formatter" failed to run: spawnSync my-formatter ENOENT'); }); - it('should throw when the process exits with a non-zero status code', () => { + 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(() => @@ -105,6 +162,18 @@ describe('postprocessOutput', () => { ).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(); diff --git a/packages/shared/src/config/output/postprocess.ts b/packages/shared/src/config/output/postprocess.ts index b25ef14caa..9c82ec7c3d 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,15 @@ export function postprocessOutput( postProcessors: Record, jobPrefix: string, ): void { + if (!config.postProcess.length) { + return; + } + + // skip post-processing when the output directory doesn't exist or is empty + 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; @@ -63,16 +76,16 @@ export function postprocessOutput( const result = sync(resolved.command, args); if (result.error) { - throw new Error(`Post-processor "${name}" failed to run: ${result.error.message}`); + throw new ConfigError(`Post-processor "${name}" failed to run: ${result.error.message}`); } - if (result.status !== 0) { + 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 Error(message); + throw new ConfigError(message); } } } From 94b26ef9bd0cd7973ae226140bd4ba207d4273a3 Mon Sep 17 00:00:00 2001 From: "pullfrog[bot]" <226033991+pullfrog[bot]@users.noreply.github.com> Date: Sat, 4 Apr 2026 00:02:59 +0000 Subject: [PATCH 06/10] fix: warn on post-processor non-zero exit instead of throwing Post-processors like ESLint and Oxfmt can exit non-zero for non-fatal reasons (e.g. all files ignored, no matching files). Previously these were silently swallowed; the prior commit made them throw ConfigError which broke examples:generate for openapi-ts-nestjs and openapi-ts-openai. Now non-zero exits log a warning and continue processing. Spawn failures (ENOENT) still throw as intended by the original fix. --- .../output/__tests__/postprocess.test.ts | 72 ++++++++++++------- .../shared/src/config/output/postprocess.ts | 2 +- 2 files changed, 46 insertions(+), 28 deletions(-) diff --git a/packages/shared/src/config/output/__tests__/postprocess.test.ts b/packages/shared/src/config/output/__tests__/postprocess.test.ts index 9577f46b9e..a718e3176d 100644 --- a/packages/shared/src/config/output/__tests__/postprocess.test.ts +++ b/packages/shared/src/config/output/__tests__/postprocess.test.ts @@ -122,44 +122,62 @@ describe('postprocessOutput', () => { ).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', () => { + it('should warn when the process exits with a non-zero status code', () => { mockSync.mockReturnValue({ error: undefined, status: 1, stderr: Buffer.from('') } as any); + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); - 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); + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ); - expect(() => - postprocessOutput( - { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, - noopPostProcessors, - '', - ), - ).toThrow('Post-processor "prettier" exited with code 1'); + expect(warnSpy).toHaveBeenCalledWith( + expect.stringContaining('Post-processor "prettier" exited with code 1'), + ); + warnSpy.mockRestore(); }); - it('should include stderr output in error message when process fails', () => { + it('should include stderr in warning when process exits with non-zero status', () => { mockSync.mockReturnValue({ error: undefined, status: 2, stderr: Buffer.from('error: file not found'), } as any); + const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); - expect(() => - postprocessOutput( - { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'biome' }] }, - noopPostProcessors, - '', - ), - ).toThrow('Post-processor "biome" exited with code 2:\nerror: file not found'); + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'biome' }] }, + noopPostProcessors, + '', + ); + + expect(warnSpy).toHaveBeenCalledTimes(1); + const warnArg = warnSpy.mock.calls[0]![0] as string; + expect(warnArg).toContain('Post-processor "biome" exited with code 2:'); + expect(warnArg).toContain('error: file not found'); + warnSpy.mockRestore(); + }); + + it('should continue processing after a non-zero exit code', () => { + mockSync + .mockReturnValueOnce({ error: undefined, status: 1, stderr: Buffer.from('') } as any) + .mockReturnValueOnce({ error: undefined, status: 0 } as any); + vi.spyOn(console, 'warn').mockImplementation(() => {}); + + postprocessOutput( + { + ...baseConfig, + postProcess: [ + { args: ['{{path}}'], command: 'first' }, + { args: ['{{path}}'], command: 'second' }, + ], + }, + noopPostProcessors, + '', + ); + + expect(mockSync).toHaveBeenCalledTimes(2); }); it('should not throw when the process is killed by a signal (null status)', () => { diff --git a/packages/shared/src/config/output/postprocess.ts b/packages/shared/src/config/output/postprocess.ts index 9c82ec7c3d..f09673e770 100644 --- a/packages/shared/src/config/output/postprocess.ts +++ b/packages/shared/src/config/output/postprocess.ts @@ -85,7 +85,7 @@ export function postprocessOutput( if (stderr) { message += `:\n${stderr}`; } - throw new ConfigError(message); + console.warn(`${jobPrefix}${colors.yellow(`⚠️ ${message}`)}`); } } } From bb2ff1b80c17d065ce887633390c1ab20b6fc8c6 Mon Sep 17 00:00:00 2001 From: "pullfrog[bot]" <226033991+pullfrog[bot]@users.noreply.github.com> Date: Sat, 4 Apr 2026 00:47:31 +0000 Subject: [PATCH 07/10] fix: silently ignore non-zero post-processor exit codes Post-processors like ESLint and Oxfmt exit non-zero for non-fatal reasons (all files ignored, no matching files). Warnings from console.warn break CI pipelines that treat stderr as errors. Only actual spawn failures (ENOENT) are reported. --- .../output/__tests__/postprocess.test.ts | 30 ++++--------------- .../shared/src/config/output/postprocess.ts | 12 +++----- 2 files changed, 9 insertions(+), 33 deletions(-) diff --git a/packages/shared/src/config/output/__tests__/postprocess.test.ts b/packages/shared/src/config/output/__tests__/postprocess.test.ts index a718e3176d..3b05c0a6b7 100644 --- a/packages/shared/src/config/output/__tests__/postprocess.test.ts +++ b/packages/shared/src/config/output/__tests__/postprocess.test.ts @@ -122,40 +122,21 @@ describe('postprocessOutput', () => { ).toThrow('Post-processor "My Formatter" failed to run: spawnSync my-formatter ENOENT'); }); - it('should warn when the process exits with a non-zero status code', () => { - mockSync.mockReturnValue({ error: undefined, status: 1, stderr: Buffer.from('') } as any); - const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); - - postprocessOutput( - { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, - noopPostProcessors, - '', - ); - - expect(warnSpy).toHaveBeenCalledWith( - expect.stringContaining('Post-processor "prettier" exited with code 1'), - ); - warnSpy.mockRestore(); - }); - - it('should include stderr in warning when process exits with non-zero status', () => { + it('should silently ignore non-zero exit codes', () => { mockSync.mockReturnValue({ error: undefined, - status: 2, - stderr: Buffer.from('error: file not found'), + status: 1, + stderr: Buffer.from('some error'), } as any); const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); postprocessOutput( - { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'biome' }] }, + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, noopPostProcessors, '', ); - expect(warnSpy).toHaveBeenCalledTimes(1); - const warnArg = warnSpy.mock.calls[0]![0] as string; - expect(warnArg).toContain('Post-processor "biome" exited with code 2:'); - expect(warnArg).toContain('error: file not found'); + expect(warnSpy).not.toHaveBeenCalled(); warnSpy.mockRestore(); }); @@ -163,7 +144,6 @@ describe('postprocessOutput', () => { mockSync .mockReturnValueOnce({ error: undefined, status: 1, stderr: Buffer.from('') } as any) .mockReturnValueOnce({ error: undefined, status: 0 } as any); - vi.spyOn(console, 'warn').mockImplementation(() => {}); postprocessOutput( { diff --git a/packages/shared/src/config/output/postprocess.ts b/packages/shared/src/config/output/postprocess.ts index f09673e770..c1cab2f4c3 100644 --- a/packages/shared/src/config/output/postprocess.ts +++ b/packages/shared/src/config/output/postprocess.ts @@ -79,13 +79,9 @@ export function postprocessOutput( 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}`; - } - console.warn(`${jobPrefix}${colors.yellow(`⚠️ ${message}`)}`); - } + // non-zero exit codes are silently ignored — post-processors like + // ESLint and Oxfmt exit non-zero for non-fatal reasons (e.g. all + // files ignored, no matching files) and warnings break CI pipelines + // that treat any stderr output as an error } } From e4c8b6108e4a9eb8c44de3c13e049a102600b224 Mon Sep 17 00:00:00 2001 From: Lubos Date: Sat, 4 Apr 2026 10:50:06 +0200 Subject: [PATCH 08/10] chore: bring back errors --- .../output/__tests__/postprocess.test.ts | 64 ++++++++++--------- .../shared/src/config/output/postprocess.ts | 17 +++-- 2 files changed, 41 insertions(+), 40 deletions(-) diff --git a/packages/shared/src/config/output/__tests__/postprocess.test.ts b/packages/shared/src/config/output/__tests__/postprocess.test.ts index 3b05c0a6b7..9577f46b9e 100644 --- a/packages/shared/src/config/output/__tests__/postprocess.test.ts +++ b/packages/shared/src/config/output/__tests__/postprocess.test.ts @@ -122,42 +122,44 @@ describe('postprocessOutput', () => { ).toThrow('Post-processor "My Formatter" failed to run: spawnSync my-formatter ENOENT'); }); - it('should silently ignore non-zero exit codes', () => { - mockSync.mockReturnValue({ - error: undefined, - status: 1, - stderr: Buffer.from('some error'), - } as any); - const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {}); - - postprocessOutput( - { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, - noopPostProcessors, - '', - ); + 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(warnSpy).not.toHaveBeenCalled(); - warnSpy.mockRestore(); + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ), + ).toThrow(ConfigError); }); - it('should continue processing after a non-zero exit code', () => { - mockSync - .mockReturnValueOnce({ error: undefined, status: 1, stderr: Buffer.from('') } as any) - .mockReturnValueOnce({ error: undefined, status: 0 } as any); + it('should include exit code in error message', () => { + mockSync.mockReturnValue({ error: undefined, status: 1, stderr: Buffer.from('') } as any); - postprocessOutput( - { - ...baseConfig, - postProcess: [ - { args: ['{{path}}'], command: 'first' }, - { args: ['{{path}}'], command: 'second' }, - ], - }, - noopPostProcessors, - '', - ); + expect(() => + postprocessOutput( + { ...baseConfig, postProcess: [{ args: ['{{path}}'], command: 'prettier' }] }, + noopPostProcessors, + '', + ), + ).toThrow('Post-processor "prettier" exited with code 1'); + }); - expect(mockSync).toHaveBeenCalledTimes(2); + 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)', () => { diff --git a/packages/shared/src/config/output/postprocess.ts b/packages/shared/src/config/output/postprocess.ts index c1cab2f4c3..a54f324f19 100644 --- a/packages/shared/src/config/output/postprocess.ts +++ b/packages/shared/src/config/output/postprocess.ts @@ -54,11 +54,6 @@ export function postprocessOutput( postProcessors: Record, jobPrefix: string, ): void { - if (!config.postProcess.length) { - return; - } - - // skip post-processing when the output directory doesn't exist or is empty if (!fs.existsSync(config.path) || fs.readdirSync(config.path).length === 0) { return; } @@ -79,9 +74,13 @@ export function postprocessOutput( throw new ConfigError(`Post-processor "${name}" failed to run: ${result.error.message}`); } - // non-zero exit codes are silently ignored — post-processors like - // ESLint and Oxfmt exit non-zero for non-fatal reasons (e.g. all - // files ignored, no matching files) and warnings break CI pipelines - // that treat any stderr output as an error + 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); + } } } From 1a945434f7218d25e89f3b930787bd03b97710df Mon Sep 17 00:00:00 2001 From: Lubos Date: Sat, 4 Apr 2026 11:03:45 +0200 Subject: [PATCH 09/10] chore: fix tests --- .oxfmtrc.json | 1 - eslint.config.js | 10 +- .../src/client/nestjs.gen.ts | 2 +- .../openapi-ts-nestjs/src/client/types.gen.ts | 4 +- .../src/client/client.gen.ts | 8 +- .../src/client/client/types.gen.ts | 5 +- .../openapi-ts-openai/src/client/index.ts | 1154 +- .../openapi-ts-openai/src/client/sdk.gen.ts | 6037 +-- .../openapi-ts-openai/src/client/types.gen.ts | 34146 ++++++++-------- .../openapi-ts-pinia-colada/.eslintrc.cjs | 1 - .../.eslintrc.cjs | 1 - 11 files changed, 22063 insertions(+), 19306 deletions(-) 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-nestjs/src/client/nestjs.gen.ts b/examples/openapi-ts-nestjs/src/client/nestjs.gen.ts index a754da6e5e..fbfb295933 100644 --- a/examples/openapi-ts-nestjs/src/client/nestjs.gen.ts +++ b/examples/openapi-ts-nestjs/src/client/nestjs.gen.ts @@ -15,9 +15,9 @@ import type { } from './types.gen'; export type PetsControllerMethods = { - listPets: (query?: ListPetsData['query']) => Promise; createPet: (body: CreatePetData['body']) => Promise; deletePet: (path: DeletePetData['path']) => Promise; + listPets: (query?: ListPetsData['query']) => Promise; showPetById: (path: ShowPetByIdData['path']) => Promise; updatePet: ( path: UpdatePetData['path'], diff --git a/examples/openapi-ts-nestjs/src/client/types.gen.ts b/examples/openapi-ts-nestjs/src/client/types.gen.ts index 8bfc020de2..0c5904f24a 100644 --- a/examples/openapi-ts-nestjs/src/client/types.gen.ts +++ b/examples/openapi-ts-nestjs/src/client/types.gen.ts @@ -7,8 +7,8 @@ export type ClientOptions = { export type Pet = { id: string; name: string; - tag?: string; status?: 'available' | 'pending' | 'sold'; + tag?: string; }; export type CreatePetBody = { @@ -18,8 +18,8 @@ export type CreatePetBody = { export type UpdatePetBody = { name?: string; - tag?: string; status?: 'available' | 'pending' | 'sold'; + tag?: string; }; export type Error = { 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..a06b9cd241 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` - */ - object: string; + /** + * The Unix timestamp (in seconds) of when the API key was created + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The Unix timestamp (in seconds) of when the API key was last used + */ + last_used_at: number; + /** + * The name of the API key + */ + name: string; + /** + * The object type, which is always `organization.admin_api_key` + */ + object: string; + owner: { + /** + * The Unix timestamp (in seconds) of when the user was created + */ + created_at?: number; /** * The identifier, which can be referenced in API endpoints */ - id: string; - /** - * The name of the API key - */ - name: string; + id?: string; /** - * The redacted value of the API key + * The name of the user */ - redacted_value: string; + name?: string; /** - * The value of the API key. Only shown on create. + * The object type, which is always organization.user */ - value?: string; + object?: string; /** - * The Unix timestamp (in seconds) of when the API key was created + * Always `owner` */ - created_at: number; + role?: string; /** - * The Unix timestamp (in seconds) of when the API key was last used + * Always `user` */ - 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; - }; + type?: string; + }; + /** + * The redacted value of the API key + */ + redacted_value: string; + /** + * The value of the API key. Only shown on create. + */ + value?: string; }; export type ApiKeyList = { - object?: string; - data?: Array; - has_more?: boolean; - first_id?: string; - last_id?: string; + data?: Array; + first_id?: string; + has_more?: boolean; + last_id?: string; + object?: 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 Unix timestamp (in seconds) for when the assistant was created. + */ + created_at: number; + /** + * The description of the assistant. The maximum length is 512 characters. + * + */ + description: string; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * + */ + instructions: string; + metadata: Metadata; + /** + * 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 name of the assistant. The maximum length is 256 characters. + * + */ + name: string; + /** + * The object type, which is always `assistant`. + */ + object: 'assistant'; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + /** + * 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; + }; + }; + /** + * 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; + /** + * 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; }; /** @@ -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_4O: 'gpt-4o', + GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', + GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', + GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', + GPT_4_1: 'gpt-4.1', + GPT_4O_MINI: 'gpt-4o-mini', + GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', + GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', + GPT_4_1_MINI: 'gpt-4.1-mini', + GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', + GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', + GPT_4: 'gpt-4', + GPT_4_1_NANO: 'gpt-4.1-nano', + GPT_4_0314: 'gpt-4-0314', + GPT_5: 'gpt-5', + GPT_4_0613: 'gpt-4-0613', + GPT_5_2025_08_07: 'gpt-5-2025-08-07', + GPT_3_5_TURBO: 'gpt-3.5-turbo', + GPT_5_MINI: 'gpt-5-mini', + GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', + GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', + GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', + GPT_5_NANO: 'gpt-5-nano', + GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', + GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', + GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07', + GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613', + GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', + GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', + O1: 'o1', + GPT_4_32K: 'gpt-4-32k', + O3_MINI: 'o3-mini', + GPT_4_32K_0314: 'gpt-4-32k-0314', + O3_MINI_2025_01_31: 'o3-mini-2025-01-31', + GPT_4_32K_0613: 'gpt-4-32k-0613', + O1_2024_12_17: 'o1-2024-12-17', + 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_TURBO_PREVIEW: 'gpt-4-turbo-preview', + GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', } 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 = { + /** + * 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; + }; + /** + * The type of tool being defined: `file_search` + */ + type: 'file_search'; }; /** * 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; + function: FunctionObject; + /** + * The type of tool being defined: `function` + */ + type: 'function'; }; /** @@ -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 = { + 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; + }; + /** + * The type of the tool. If type is `function`, the function name must be set + */ + type: 'function' | 'code_interpreter' | 'file_search'; }; /** @@ -339,588 +367,588 @@ export type AssistantsNamedToolChoice = { * */ export const AudioResponseFormat = { - JSON: 'json', - TEXT: 'text', - SRT: 'srt', - VERBOSE_JSON: 'verbose_json', - VTT: 'vtt' + JSON: 'json', + SRT: 'srt', + TEXT: 'text', + 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 = { + actor: AuditLogActor; + /** + * The details for events with this `type`. + */ + 'api_key.created'?: { /** - * The ID of this log. + * The payload used to create the API key. */ - id: string; - type: AuditLogEventType; + data?: { + /** + * A list of scopes allowed for the API key, e.g. `["api.model.request"]` + */ + scopes?: Array; + }; /** - * The Unix timestamp (in seconds) of the event. + * The tracking ID of the API key. */ - effective_at: number; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'api_key.deleted'?: { /** - * 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 tracking ID of the API key. */ - project?: { - /** - * The project ID. - */ - id?: string; - /** - * The project title. - */ - name?: string; - }; - actor: AuditLogActor; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'api_key.updated'?: { /** - * The details for events with this `type`. + * The payload used to update 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; - }; + 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`. + * The tracking ID of 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; - }; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificate.created'?: { /** - * The details for events with this `type`. + * The certificate ID. */ - '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. + * The name of the certificate. */ - '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; - }; - }; + name?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificate.deleted'?: { /** - * The details for events with this `type`. + * The certificate content in PEM format. */ - 'checkpoint_permission.deleted'?: { - /** - * The ID of the checkpoint permission. - */ - id?: string; - }; + certificate?: string; /** - * The details for events with this `type`. + * The certificate ID. */ - '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 name of the certificate. */ - 'invite.accepted'?: { - /** - * The ID of the invite. - */ - id?: string; - }; + name?: string; + }; + /** + * The details for events with this `type`. + */ + 'certificate.updated'?: { /** - * The details for events with this `type`. + * The certificate ID. */ - 'invite.deleted'?: { - /** - * The ID of the invite. - */ - id?: string; - }; + id?: string; /** - * The details for events with this `type`. + * The name of the certificate. */ - 'login.failed'?: { - /** - * The error code of the failure. - */ - error_code?: string; - /** - * The error message of the failure. - */ - error_message?: string; - }; + name?: 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 project and fine-tuned model checkpoint that the checkpoint permission was created for. + */ + 'checkpoint_permission.created'?: { /** - * The details for events with this `type`. + * The payload used to create the checkpoint permission. */ - 'logout.failed'?: { - /** - * The error code of the failure. - */ - error_code?: string; - /** - * The error message of the failure. - */ - error_message?: string; + data?: { + /** + * The ID of the fine-tuned model checkpoint. + */ + fine_tuned_model_checkpoint?: string; + /** + * The ID of the project that the checkpoint permission was created for. + */ + project_id?: string; }; /** - * The details for events with this `type`. + * The ID of the checkpoint permission. */ - '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; - }; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'checkpoint_permission.deleted'?: { /** - * The details for events with this `type`. + * The ID of the checkpoint permission. */ - '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; - }; - }; + id?: string; + }; + /** + * The Unix timestamp (in seconds) of the event. + */ + effective_at: number; + /** + * The ID of this log. + */ + id: 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. */ - '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`. + */ + 'invite.sent'?: { /** - * The details for events with this `type`. + * The payload used to create the invite. */ - 'project.archived'?: { - /** - * The project ID. - */ - 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`. + * The ID of the invite. */ - '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; - }; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'login.failed'?: { + /** + * The error code of the failure. + */ + error_code?: string; + /** + * The error message of the failure. + */ + error_message?: string; + }; + /** + * The details for events with this `type`. + */ + 'logout.failed'?: { + /** + * The error code of the failure. + */ + error_code?: string; + /** + * The error message of the failure. + */ + error_message?: string; + }; + /** + * The details for events with this `type`. + */ + 'organization.updated'?: { + /** + * The payload used to update the organization settings. + */ + changes_requested?: { + /** + * 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 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; + /** + * The organization title. + */ + title?: string; + /** + * Visibility of the usage dashboard which shows activity and costs for your organization. One of `ANY_ROLE` or `OWNERS`. + */ + usage_dashboard_visibility?: string; + }; + /** + * The organization ID. + */ + 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. + */ + project?: { /** - * The details for events with this `type`. + * The project ID. */ - 'rate_limit.deleted'?: { - /** - * The rate limit ID - */ - id?: string; - }; + id?: string; /** - * The details for events with this `type`. + * The project title. */ - '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; - }; - }; + name?: string; + }; + /** + * The details for events with this `type`. + */ + 'project.archived'?: { /** - * The details for events with this `type`. + * The project 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`. + */ + 'project.created'?: { /** - * The details for events with this `type`. + * The payload used to create the project. */ - 'service_account.deleted'?: { - /** - * The service account ID. - */ - id?: string; + 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`. + * The project 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`. + */ + 'project.updated'?: { /** - * The details for events with this `type`. + * The payload used to update the project. */ - '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; - }; + changes_requested?: { + /** + * The title of the project as seen on the dashboard. + */ + title?: string; }; /** - * The details for events with this `type`. + * The project ID. */ - 'user.deleted'?: { - /** - * The user ID. - */ - id?: string; - }; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'rate_limit.deleted'?: { /** - * The details for events with this `type`. + * The rate limit ID */ - 'certificate.created'?: { - /** - * 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.updated'?: { - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; + 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; }; + }; + /** + * The details for events with this `type`. + */ + 'user.updated'?: { /** - * The details for events with this `type`. + * The project 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 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`. + */ + 'service_account.deleted'?: { /** - * The details for events with this `type`. + * The service account ID. */ - 'certificates.activated'?: { - certificates?: Array<{ - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; - }>; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'service_account.updated'?: { + /** + * The payload used to updated the service account. + */ + changes_requested?: { + /** + * The role of the service account. Is either `owner` or `member`. + */ + role?: string; }; /** - * The details for events with this `type`. + * The service account ID. */ - 'certificates.deactivated'?: { - certificates?: Array<{ - /** - * The certificate ID. - */ - id?: string; - /** - * The name of the certificate. - */ - name?: string; - }>; + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'rate_limit.updated'?: { + /** + * 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 rate limit ID + */ + id?: string; + }; + type: AuditLogEventType; + /** + * The details for events with this `type`. + */ + 'service_account.created'?: { + /** + * The payload used to create the service account. + */ + data?: { + /** + * The role of the service account. Is either `owner` or `member`. + */ + role?: string; }; + /** + * The service account ID. + */ + id?: string; + }; + /** + * The details for events with this `type`. + */ + 'user.deleted'?: { + /** + * The user ID. + */ + id?: 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; + api_key?: AuditLogActorApiKey; + session?: AuditLogActorSession; + /** + * The type of actor. Is either `session` or `api_key`. + */ + type?: 'session' | 'api_key'; }; /** * 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; + service_account?: AuditLogActorServiceAccount; + /** + * The type of API key. Can be either `user` or `service_account`. + */ + type?: 'user' | 'service_account'; + user?: AuditLogActorUser; }; /** * 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; + /** + * The IP address from which the action was performed. + */ + ip_address?: string; + user?: AuditLogActorUser; }; /** * The user who performed the audit logged action. */ export type AuditLogActorUser = { - /** - * The user id. - */ - id?: string; - /** - * The user email. - */ - email?: string; + /** + * The user email. + */ + email?: string; + /** + * The user id. + */ + id?: 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_DELETED: 'api_key.deleted', + API_KEY_UPDATED: 'api_key.updated', + CHECKPOINT_PERMISSION_CREATED: 'checkpoint_permission.created', + CHECKPOINT_PERMISSION_DELETED: 'checkpoint_permission.deleted', + INVITE_ACCEPTED: 'invite.accepted', + INVITE_DELETED: 'invite.deleted', + INVITE_SENT: 'invite.sent', + LOGIN_FAILED: 'login.failed', + LOGIN_SUCCEEDED: 'login.succeeded', + LOGOUT_FAILED: 'logout.failed', + LOGOUT_SUCCEEDED: 'logout.succeeded', + ORGANIZATION_UPDATED: 'organization.updated', + PROJECT_ARCHIVED: 'project.archived', + PROJECT_CREATED: 'project.created', + PROJECT_UPDATED: 'project.updated', + RATE_LIMIT_DELETED: 'rate_limit.deleted', + RATE_LIMIT_UPDATED: 'rate_limit.updated', + SERVICE_ACCOUNT_CREATED: 'service_account.created', + SERVICE_ACCOUNT_DELETED: 'service_account.deleted', + SERVICE_ACCOUNT_UPDATED: 'service_account.updated', + USER_ADDED: 'user.added', + USER_DELETED: 'user.deleted', + USER_UPDATED: 'user.updated', } 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. + /** + * The Unix timestamp (in seconds) for when the batch was cancelled. + */ + cancelled_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 completed. + */ + completed_at?: number; + /** + * The time frame within which the batch should be processed. + */ + completion_window: string; + /** + * The Unix timestamp (in seconds) for when the batch was created. + */ + created_at: number; + /** + * The OpenAI API endpoint used by the batch. + */ + endpoint: string; + /** + * The ID of the file containing the outputs of requests with errors. + */ + error_file_id?: string; + errors?: { + data?: Array; + /** + * The object type, which is always `list`. */ - cancelled_at?: number; - request_counts?: BatchRequestCounts; - metadata?: Metadata; + object?: string; + }; + /** + * The Unix timestamp (in seconds) for when the batch expired. + */ + expired_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 failed. + */ + failed_at?: number; + /** + * The Unix timestamp (in seconds) for when the batch started finalizing. + */ + finalizing_at?: number; + id: string; + /** + * The Unix timestamp (in seconds) for when the batch started processing. + */ + in_progress_at?: number; + /** + * The ID of the input file for the batch. + */ + input_file_id: string; + metadata?: Metadata; + /** + * The object type, which is always `batch`. + */ + object: 'batch'; + /** + * The ID of the file containing the outputs of successfully executed requests. + */ + output_file_id?: string; + request_counts?: BatchRequestCounts; + /** + * The current status of the batch. + */ + status: + | 'validating' + | 'failed' + | 'in_progress' + | 'finalizing' + | 'completed' + | 'expired' + | 'cancelling' + | 'cancelled'; }; /** @@ -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; + /** + * A developer-provided per-request id that will be used to match outputs to inputs. + */ + custom_id?: string; + /** + * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure. + */ + error?: { /** - * A developer-provided per-request id that will be used to match outputs to inputs. + * A machine-readable error code. */ - 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; - }; - }; + code?: string; /** - * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure. + * A human-readable error message. */ - error?: { - /** - * A machine-readable error code. - */ - code?: string; - /** - * A human-readable error message. - */ - message?: string; + message?: string; + }; + id?: string; + response?: { + /** + * The JSON body of the response + */ + body?: { + [key: string]: unknown; }; + /** + * An unique identifier for the OpenAI API request. Please include this request ID when contacting support. + */ + request_id?: string; + /** + * The HTTP status code of the response + */ + status_code?: number; + }; }; /** * Represents an individual `certificate` uploaded to the organization. */ export type Certificate = { + /** + * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. + */ + active?: boolean; + certificate_details: { /** - * 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 content of the certificate in PEM format. */ - name: string; + content?: string; /** - * The Unix timestamp (in seconds) of when the certificate was uploaded. + * The Unix timestamp (in seconds) of when the certificate expires. */ - 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. - */ - active?: boolean; + * The Unix timestamp (in seconds) of when the certificate becomes valid. + */ + valid_at?: number; + }; + /** + * The Unix timestamp (in seconds) of when the certificate was uploaded. + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the certificate. + */ + name: string; + /** + * 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'; }; /** @@ -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_tools: ChatCompletionAllowedTools; + /** + * Allowed tool configuration type. Always `allowed_tools`. + */ + type: 'allowed_tools'; }; 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; + /** + * Whether the chat completion was deleted. + */ + deleted: boolean; + /** + * The ID of the chat completion that was deleted. + */ + id: string; + /** + * The type of object being deleted. + */ + object: 'chat.completion.deleted'; }; /** @@ -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; + /** + * An array of chat completion objects. + * + */ + data: Array; + /** + * The identifier of the first chat completion in the data array. + */ + first_id: string; + /** + * Indicates whether there are more Chat Completions available. + */ + has_more: boolean; + /** + * The identifier of the last chat completion in the data array. + */ + last_id: string; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; }; /** @@ -1257,27 +1293,27 @@ export type ChatCompletionList = { * */ export type ChatCompletionMessageCustomToolCall = { + /** + * The custom tool that the model called. + */ + custom: { /** - * The ID of the tool call. - */ - id: string; - /** - * The type of the tool. Always `custom`. + * The input for the custom tool call generated by the model. */ - type: 'custom'; + input: string; /** - * The custom tool that the model called. + * The name of the custom tool to call. */ - custom: { - /** - * The name of the custom tool to call. - */ - name: string; - /** - * The input for the custom tool call generated by the model. - */ - input: string; - }; + name: string; + }; + /** + * The ID of the tool call. + */ + id: string; + /** + * The type of the tool. Always `custom`. + */ + type: 'custom'; }; /** @@ -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; + /** + * An array of chat completion message objects. + * + */ + data: Array< + ChatCompletionResponseMessage & { + /** + * 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 chat message. + */ + id: string; + } + >; + /** + * The identifier of the first chat message in the data array. + */ + first_id: string; + /** + * Indicates whether there are more chat messages available. + */ + has_more: boolean; + /** + * The identifier of the last chat message in the data array. + */ + last_id: string; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; }; /** @@ -1329,59 +1369,62 @@ export type ChatCompletionMessageList = { * */ export type ChatCompletionMessageToolCall = { + /** + * The function that the model called. + */ + function: { /** - * The ID of the tool 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. */ - id: string; - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; + arguments: string; /** - * The function that the model called. + * The name of the function to call. */ - 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; - }; + name: string; + }; + /** + * The ID of the tool call. + */ + id: string; + /** + * The type of the tool. Currently, only `function` is supported. + */ + type: 'function'; }; export type ChatCompletionMessageToolCallChunk = { - index: number; + function?: { /** - * The ID of the tool 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. */ - id?: string; + arguments?: string; /** - * The type of the tool. Currently, only `function` is supported. + * The name of the function to call. */ - 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; - }; + name?: string; + }; + /** + * The ID of the tool call. + */ + id?: string; + index: number; + /** + * The type of the tool. Currently, only `function` is supported. + */ + type?: 'function'; }; /** * 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 = { + 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; + }; + /** + * For function calling, the type is always `function`. + */ + type: 'function'; }; /** @@ -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 = { + 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; + }; + /** + * For custom tool calling, the type is always `custom`. + */ + type: 'custom'; }; /** @@ -1441,58 +1484,60 @@ export type ChatCompletionNamedToolChoiceCustom = { * */ export type ChatCompletionRequestAssistantMessage = { + /** + * Data about a previous audio response from the model. + * [Learn more](https://platform.openai.com/docs/guides/audio). + * + */ + audio?: { /** - * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + * 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; - /** - * Data about a previous audio response from the model. - * [Learn more](https://platform.openai.com/docs/guides/audio). - * + id: string; + }; + /** + * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. + * + */ + content?: string | Array; + /** + * 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. */ - 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; - }; -}; - -export type ChatCompletionRequestAssistantMessageContentPart = ({ - type?: 'ChatCompletionRequestMessageContentPartText'; -} & ChatCompletionRequestMessageContentPartText) | ({ - type?: 'ChatCompletionRequestMessageContentPartRefusal'; -} & ChatCompletionRequestMessageContentPartRefusal); + name: string; + }; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; + /** + * The refusal message by the assistant. + */ + refusal?: string; + /** + * The role of the messages author, in this case `assistant`. + */ + role: 'assistant'; + tool_calls?: ChatCompletionMessageToolCalls; +}; + +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; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; + /** + * The role of the messages author, in this case `developer`. + */ + role: 'developer'; }; /** @@ -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 contents of the function message. + */ + content: string; + /** + * The name of the function to call. + */ + name: string; + /** + * The role of the messages author, in this case `function`. + */ + role: 'function'; +}; + +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 = { + 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'; + }; + /** + * The type of the content part. Always `input_audio`. + */ + type: 'input_audio'; }; /** @@ -1582,29 +1633,29 @@ export type ChatCompletionRequestMessageContentPartAudio = { * */ export type ChatCompletionRequestMessageContentPartFile = { + file: { /** - * The type of the content part. Always `file`. + * The base64 encoded file data, 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; - }; + file_data?: string; + /** + * The ID of an uploaded file to use as input. + * + */ + file_id?: string; + /** + * The name of the file, used when passing the file to the model as a + * string. + * + */ + filename?: string; + }; + /** + * The type of the content part. Always `file`. + */ + type: 'file'; }; /** @@ -1614,34 +1665,34 @@ export type ChatCompletionRequestMessageContentPartFile = { * */ export type ChatCompletionRequestMessageContentPartImage = { + image_url: { /** - * The type of the content part. + * 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). */ - 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'; - }; + detail?: 'auto' | 'low' | 'high'; + /** + * Either a URL of the image or the base64 encoded image data. + */ + url: string; + }; + /** + * The type of the content part. + */ + type: 'image_url'; }; /** * Refusal content part */ export type ChatCompletionRequestMessageContentPartRefusal = { - /** - * The type of the content part. - */ - type: 'refusal'; - /** - * The refusal message generated by the model. - */ - refusal: string; + /** + * The refusal message generated by the model. + */ + refusal: string; + /** + * The type of the content part. + */ + type: 'refusal'; }; /** @@ -1651,14 +1702,14 @@ export type ChatCompletionRequestMessageContentPartRefusal = { * */ export type ChatCompletionRequestMessageContentPartText = { - /** - * The type of the content part. - */ - type: 'text'; - /** - * The text content. - */ - text: string; + /** + * The text content. + */ + text: string; + /** + * The type of the content part. + */ + type: 'text'; }; /** @@ -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; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; + /** + * The role of the messages author, in this case `system`. + */ + role: 'system'; }; -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 contents of the tool message. + */ + content: string | Array; + /** + * The role of the messages author, in this case `tool`. + */ + role: 'tool'; + /** + * Tool call that this message is responding to. + */ + tool_call_id: string; }; -export type ChatCompletionRequestToolMessageContentPart = ChatCompletionRequestMessageContentPartText; +export type ChatCompletionRequestToolMessageContentPart = + ChatCompletionRequestMessageContentPartText; /** * User message @@ -1714,236 +1767,240 @@ 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; + /** + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + */ + name?: string; + /** + * The role of the messages author, in this case `user`. + */ + role: 'user'; +}; + +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 = { + /** + * 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 title of the web resource. + */ + title: string; + /** + * The URL of the web resource. + */ + url: 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?: { + /** + * Base64 encoded audio bytes generated by the model, in the format + * specified in the request. + * */ - refusal: string; - tool_calls?: ChatCompletionMessageToolCalls; + data: 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 Unix timestamp (in seconds) for when this audio response will + * no longer be accessible on the server for use in multi-turn + * conversations. * */ - 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; - }; - }>; + expires_at: number; /** - * 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. - * - * @deprecated + * Transcript of the audio generated by the model. */ - 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; - }; + transcript: string; + }; + /** + * The contents of the 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; /** - * 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). - * + * The name of the function to call. */ - 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; - }; + name: string; + }; + /** + * The refusal message generated by the model. + */ + refusal: string; + /** + * The role of the author of this message. + */ + role: 'assistant'; + tool_calls?: ChatCompletionMessageToolCalls; }; /** * The role of the author of a message */ export const ChatCompletionRole = { - DEVELOPER: 'developer', - SYSTEM: 'system', - USER: 'user', - ASSISTANT: 'assistant', - TOOL: 'tool', - FUNCTION: 'function' + ASSISTANT: 'assistant', + DEVELOPER: 'developer', + FUNCTION: 'function', + SYSTEM: 'system', + TOOL: 'tool', + USER: 'user', } 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; + /** + * 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; }; /** * 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; + }; + /** + * The refusal message generated by the model. + */ + refusal?: string; + /** + * The role of the author of this message. + */ + role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool'; + tool_calls?: Array; }; 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; + /** + * 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; + /** + * The token. + */ + token: string; + /** + * 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. + * 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. */ - token: string; + bytes: Array; /** * 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. + * The token. */ - 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; - }>; + token: string; + }>; }; /** @@ -1953,11 +2010,11 @@ export type ChatCompletionTokenLogprob = { * */ export type ChatCompletionTool = { - /** - * The type of the tool. Currently, only `function` is supported. - */ - type: 'function'; - function: FunctionObject; + function: FunctionObject; + /** + * The type of the tool. Currently, only `function` is supported. + */ + type: 'function'; }; /** @@ -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; + /** + * Indicates which mouse button was pressed during the click. One of `left`, `right`, `wheel`, `back`, or `forward`. + * + */ + button: 'left' | 'right' | 'wheel' | 'back' | 'forward'; + /** + * Specifies the event type. For a click action, this property is + * always set to `click`. + * + */ + type: 'click'; + /** + * 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 = { + files: Array<{ /** - * The type of the code interpreter file output. Always `files`. + * The ID of the file. * */ - type: 'files'; - files: Array<{ - /** - * The MIME type of the file. - * - */ - mime_type: string; - /** - * The ID of the file. - * - */ - file_id: string; - }>; + file_id: string; + /** + * The MIME type of the file. + * + */ + mime_type: string; + }>; + /** + * The type of the code interpreter file output. Always `files`. + * + */ + type: 'files'; }; /** @@ -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 logs output from the code interpreter. + */ + logs: string; + /** + * The type of the output. Always 'logs'. + */ + type: 'logs'; }; /** @@ -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 logs of the code interpreter tool call. + * + */ + logs: string; + /** + * The type of the code interpreter text output. Always `logs`. + * + */ + type: 'logs'; }; /** @@ -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 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'; }; /** @@ -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; + /** + * An optional list of uploaded files to make available to your code. + * + */ + file_ids?: Array; + /** + * Always `auto`. + */ + type: 'auto'; }; /** @@ -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 code to run, or null if not available. + * + */ + code: string; + /** + * The ID of the container used to run the code. + * + */ + container_id: string; + /** + * The unique ID of the code interpreter tool call. + * + */ + id: 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) + >; + /** + * 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 type of the code interpreter tool call. Always `code_interpreter_call`. + * + */ + type: 'code_interpreter_call'; }; /** @@ -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; + /** + * The key to compare against the value. + */ + key: string; + /** + * 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 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 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; }; /** * Usage statistics for the completion request. */ export type CompletionUsage = { + /** + * Number of tokens in the generated completion. + */ + completion_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; + }; + /** + * Number of tokens in the prompt. + */ + prompt_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; + }; + /** + * Total number of tokens used in the request (prompt + completion). + */ + total_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); + /** + * Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. + */ + filters: Array; + /** + * Type of operation: `and` or `or`. + */ + type: 'and' | 'or'; +}; + +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; + /** + * The identifier of an uploaded file that contains the screenshot. + */ + file_id?: string; + /** + * The URL of the screenshot image. + */ + image_url?: string; + /** + * Specifies the event type. For a computer screenshot, this property is + * always set to `computer_screenshot`. + * + */ + type: 'computer_screenshot'; }; /** @@ -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'; + action: ComputerAction; + /** + * An identifier used when responding to the tool call with output. + * + */ + call_id: string; + /** + * The unique ID of the computer call. + */ + id: string; + /** + * 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'; }; /** @@ -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 safety checks reported by the API that have been acknowledged by the + * developer. + * + */ + acknowledged_safety_checks?: Array; + /** + * The ID of the computer tool call that produced the output. + * + */ + call_id: string; + /** + * The ID of the computer tool call output. + * + */ + id?: string; + 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'; }; 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 type of the pending safety check. + */ + code: string; + /** + * The ID of the pending safety check. + */ + id: 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; + /** + * A list of container files. + */ + data: Array; + /** + * The ID of the first file in the list. + */ + first_id: string; + /** + * Whether there are more files available. + */ + has_more: boolean; + /** + * The ID of the last file in the list. + */ + last_id: string; + /** + * The type of object returned, must be 'list'. + */ + object: 'list'; }; /** * 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; + /** + * Size of the file in bytes. + */ + bytes: number; + /** + * The container this file belongs to. + */ + container_id: string; + /** + * Unix timestamp (in seconds) when the file was created. + */ + created_at: number; + /** + * Unique identifier for the file. + */ + id: string; + /** + * The type of this object (`container.file`). + */ + object: 'container.file'; + /** + * 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; + /** + * A list of containers. + */ + data: Array; + /** + * The ID of the first container in the list. + */ + first_id: string; + /** + * Whether there are more containers available. + */ + has_more: boolean; + /** + * The ID of the last container in the list. + */ + last_id: string; + /** + * The type of object returned, must be 'list'. + */ + object: 'list'; }; /** * 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; - }; + /** + * Unix timestamp (in seconds) when the container was created. + */ + created_at: number; + /** + * 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; + /** + * Name of the container. + */ + name: string; + /** + * The type of this object. + */ + object: string; + /** + * Status of the container (e.g., active, deleted). + */ + status: string; }; /** @@ -2564,216 +2641,821 @@ 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; - }; + /** + * The monetary value in its associated currency. + */ + amount?: { /** - * When `group_by=line_item`, this field provides the line item of the grouped costs result. + * Lowercase ISO-4217 currency e.g. "usd" */ - line_item?: string; + currency?: string; /** - * When `group_by=project_id`, this field provides the project ID of the grouped costs result. + * The numeric value of the cost. */ - project_id?: string; + value?: number; + }; + /** + * When `group_by=line_item`, this field provides the line item of the grouped costs result. + */ + line_item?: string; + object: 'organization.costs.result'; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped costs result. + */ + project_id?: string; }; export type CreateAssistantRequest = { + /** + * 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; + metadata?: Metadata; + /** + * 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; + reasoning_effort?: ReasoningEffort; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + /** + * 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<{ + /** + * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + */ + chunking_strategy?: + | { + /** + * Always `auto`. + */ + type: 'auto'; + } + | { + static: { + /** + * 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; + }; + /** + * Always `static`. + */ + type: 'static'; + }; + /** + * 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; + metadata?: Metadata; + }>; + }; + }; + /** + * 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; + /** + * 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; +}; + +export type CreateChatCompletionRequest = CreateModelResponseProperties & { + /** + * Parameters for audio output. Required when audio output is requested with + * `modalities: ["audio"]`. [Learn more](https://platform.openai.com/docs/guides/audio). + * + */ + audio?: { /** - * 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. + * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, + * `opus`, or `pcm16`. * */ - model: string | AssistantSupportedModels; + format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16'; /** - * The name of the assistant. The maximum length is 256 characters. + * The voice the model uses to respond. Supported voices are + * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. * */ - name?: string; + voice: VoiceIdsShared; + }; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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; + modalities?: ResponseModalities; + /** + * 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; + /** + * 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; + parallel_tool_calls?: ParallelToolCalls; + /** + * 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; + /** + * 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; + reasoning_effort?: ReasoningEffort; + /** + * 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; + /** + * 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; + stop?: StopConfiguration; + /** + * 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; + stream_options?: ChatCompletionStreamOptions; + tool_choice?: ChatCompletionToolChoiceOption; + /** + * 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) + >; + /** + * 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; + verbosity?: Verbosity; + /** + * 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?: { + search_context_size?: WebSearchContextSize; + /** + * Approximate location parameters for the search. + * + */ + user_location?: { + approximate: WebSearchLocation; + /** + * The type of location approximation. Always `approximate`. + * + */ + type: 'approximate'; + }; + }; +}; + +/** + * Represents a chat completion response returned by model, based on the provided input. + */ +export type CreateChatCompletionResponse = { + /** + * 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; + index: number; /** - * 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; + * 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; + }; + message: ChatCompletionResponseMessage; + }>; + /** + * The Unix timestamp (in seconds) of when the chat completion was created. + */ + created: number; + /** + * A unique identifier for the chat completion. + */ + id: string; + /** + * The model used for the chat completion. + */ + model: string; + /** + * The object type, which is always `chat.completion`. + */ + object: 'chat.completion'; + 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; + 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 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. + * 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. * */ - 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; + finish_reason: 'stop' | 'length' | 'tool_calls' | 'content_filter' | 'function_call'; /** - * 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 index of the choice in the list of choices. */ - temperature?: number; + index: 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; + * 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. Each chunk has the same timestamp. + */ + created: number; + /** + * A unique identifier for the chat completion. Each chunk has the same ID. + */ + id: string; + /** + * The model to generate the completion. + */ + model: string; + /** + * The object type, which is always `chat.completion.chunk`. + */ + object: 'chat.completion.chunk'; + 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; + /** + * 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 & { - /** - * 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; +export type CreateCompletionRequest = { + /** + * 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; + /** + * 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'; + /** + * 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; + /** + * 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>; + /** + * 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 = { + /** + * The list of completion choices the model generated for the input prompt. + */ + choices: Array<{ /** - * 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 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. * */ - max_completion_tokens?: number; + 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; + /** + * A unique identifier for the completion. + */ + id: string; + /** + * The model used for completion. + */ + model: string; + /** + * The object type, which is always "text_completion" + */ + object: 'text_completion'; + /** + * 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; + usage?: CompletionUsage; +}; + +export type CreateContainerBody = { + /** + * Container expiration time in seconds relative to the 'anchor' time. + */ + expires_after?: { /** - * 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. - * + * Time anchor for the expiration time. Currently only 'last_active_at' is supported. */ - 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. - * + anchor: 'last_active_at'; + minutes: number; + }; + /** + * IDs of files to copy to the container. + */ + file_ids?: Array; + /** + * Name of the container to create. + */ + name: string; +}; + +export type CreateContainerFileBody = { + /** + * The File object (not file name) to be uploaded. + * + */ + file?: Blob | File; + /** + * Name of the file to create. + */ + file_id?: string; +}; + +export type CreateEmbeddingRequest = { + /** + * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. + * + */ + dimensions?: number; + /** + * The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). + */ + encoding_format?: 'float' | 'base64'; + /** + * 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'; + /** + * 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. */ - presence_penalty?: number; + prompt_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). - * + * The total number of tokens used by the request. */ - web_search_options?: { + total_tokens: number; + }; +}; + +/** + * CompletionsRunDataSource + * + * A CompletionsRunDataSource object describing a model sampling configuration. + * + */ +export type CreateEvalCompletionsRunDataSource = { + /** + * 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?: + | { /** - * Approximate location parameters for the search. - * + * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. */ - user_location?: { - /** - * The type of location approximation. Always `approximate`. - * - */ - type: 'approximate'; - approximate: WebSearchLocation; - }; - search_context_size?: WebSearchContextSize; - }; + template: Array< + | ({ + type?: 'EasyInputMessage'; + } & EasyInputMessage) + | ({ + type?: 'EvalItem'; + } & EvalItem) + >; + /** + * The type of input messages. Always `template`. + */ + type: 'template'; + } + | { + /** + * A reference to a variable in the `item` namespace. Ie, "item.input_trajectory" + */ + item_reference: string; + /** + * The type of input messages. Always `item_reference`. + */ + type: 'item_reference'; + }; + /** + * The name of the model to use for generating completions (e.g. "o3-mini"). + */ + model?: string; + sampling_params?: { /** - * 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. - * + * The maximum number of tokens in the generated output. */ - top_logprobs?: number; + max_completion_tokens?: number; /** * An object specifying the format that the model must output. * @@ -2789,3587 +3471,3135 @@ 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 seed value to initialize the randomness, during sampling. */ - audio?: { - /** - * The voice the model uses to respond. Supported voices are - * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. - * - */ - voice: VoiceIdsShared; - /** - * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, - * `opus`, or `pcm16`. - * - */ - format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16'; - }; + seed?: number; /** - * 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. - * + * A higher temperature increases randomness in the outputs. */ - store?: boolean; + 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 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. + * 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. * */ - stream?: boolean; - stop?: StopConfiguration; + tools?: Array; /** - * 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. - * + * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ - logit_bias?: { - [key: string]: number; - }; + top_p?: number; + }; + /** + * Determines what populates the `item` namespace in this run's data source. + */ + source: + | ({ + type?: 'EvalJsonlFileContentSource'; + } & EvalJsonlFileContentSource) + | ({ + type?: 'EvalJsonlFileIdSource'; + } & EvalJsonlFileIdSource) + | ({ + type?: 'EvalStoredCompletionsSource'; + } & EvalStoredCompletionsSource); + /** + * The type of run data source. Always `completions`. + */ + type: 'completions'; +}; + +/** + * 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 = { + /** + * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) + */ + include_sample_schema?: boolean; + /** + * The json schema for each row in the data source. + */ + item_schema: { + [key: string]: unknown; + }; + /** + * The type of data source. Always `custom`. + */ + type: 'custom'; +}; + +/** + * 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 content of the message. + */ + content: string; + /** + * The role of the message (e.g. "system", "assistant", "user"). + */ + role: string; + } + | EvalItem; + +/** + * JsonlRunDataSource + * + * A JsonlRunDataSource object with that specifies a JSONL file that matches the eval + * + */ +export type CreateEvalJsonlRunDataSource = { + /** + * Determines what populates the `item` namespace in the data source. + */ + source: + | ({ + type?: 'EvalJsonlFileContentSource'; + } & EvalJsonlFileContentSource) + | ({ + type?: 'EvalJsonlFileIdSource'; + } & EvalJsonlFileIdSource); + /** + * The type of data source. Always `jsonl`. + */ + type: 'jsonl'; +}; + +/** + * LabelModelGrader + * + * A LabelModelGrader object which uses a model to assign labels to each item + * in the evaluation. + * + */ +export type CreateEvalLabelModelGrader = { + /** + * 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 model to use for the evaluation. Must support structured outputs. + */ + model: string; + /** + * The name of the grader. + */ + name: string; + /** + * 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'; +}; + +/** + * 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 = { + /** + * Metadata filters for the logs data source. + */ + metadata?: { + [key: string]: unknown; + }; + /** + * The type of data source. Always `logs`. + */ + type: 'logs'; +}; + +/** + * CreateEvalRequest + */ +export type CreateEvalRequest = { + /** + * 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); + metadata?: Metadata; + /** + * The name of the evaluation. + */ + name?: string; + /** + * 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 = { + /** + * 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?: + | { + /** + * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + */ + template: Array< + | { + /** + * The content of the message. + */ + content: string; + /** + * The role of the message (e.g. "system", "assistant", "user"). + */ + role: string; + } + | EvalItem + >; + /** + * The type of input messages. Always `template`. + */ + type: 'template'; + } + | { + /** + * A reference to a variable in the `item` namespace. Ie, "item.name" + */ + item_reference: string; + /** + * The type of input messages. Always `item_reference`. + */ + type: 'item_reference'; + }; + /** + * The name of the model to use for generating completions (e.g. "o3-mini"). + */ + model?: string; + sampling_params?: { /** - * 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`. - * + * The maximum number of tokens in the generated output. */ - logprobs?: boolean; + max_completion_tokens?: number; /** - * 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 seed value to initialize the randomness, during sampling. */ - max_tokens?: number; + seed?: 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. + * A higher temperature increases randomness in the outputs. */ - n?: number; + temperature?: 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. + * 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) * */ - prediction?: { - type?: 'PredictionContent'; - } & PredictionContent; + text?: { + format?: TextResponseFormatConfiguration; + }; /** - * 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. + * 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: * - * @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). + * - **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). * */ - tools?: Array<({ - type?: 'ChatCompletionTool'; - } & ChatCompletionTool) | ({ - type?: 'CustomToolChatCompletions'; - } & CustomToolChatCompletions)>; - tool_choice?: ChatCompletionToolChoiceOption; - parallel_tool_calls?: ParallelToolCalls; + tools?: Array; /** - * 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 + * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ - function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption; - /** - * Deprecated in favor of `tools`. - * - * A list of functions the model may generate JSON inputs for. - * - * - * @deprecated - */ - functions?: Array; + top_p?: number; + }; + /** + * Determines what populates the `item` namespace in this run's data source. + */ + source: + | ({ + type?: 'EvalJsonlFileContentSource'; + } & EvalJsonlFileContentSource) + | ({ + type?: 'EvalJsonlFileIdSource'; + } & EvalJsonlFileIdSource) + | ({ + type?: 'EvalResponsesSource'; + } & EvalResponsesSource); + /** + * The type of run data source. Always `responses`. + */ + type: 'responses'; }; /** - * 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 = { + /** + * Details about the run's data source. + */ + data_source: + | CreateEvalJsonlRunDataSource + | CreateEvalCompletionsRunDataSource + | CreateEvalResponsesRunDataSource; + metadata?: Metadata; + /** + * The name of the run. + */ + name?: string; }; /** - * 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 = { + /** + * Metadata filters for the stored completions data source. + */ + metadata?: { + [key: string]: unknown; + }; + /** + * The type of data source. Always `stored_completions`. + */ + type: 'stored_completions'; }; -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>; +export type CreateFileRequest = { + expires_after?: FileExpirationAfter; + /** + * The File object (not file name) to be uploaded. + * + */ + file: Blob | File; + purpose: FilePurpose; +}; + +export type CreateFineTuningCheckpointPermissionRequest = { + /** + * The project identifiers to grant access to. + */ + project_ids: Array; +}; + +export type CreateFineTuningJobRequest = { + /** + * 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?: { /** - * 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`. + * Number of examples in each batch. A larger batch size means that model parameters + * are updated less frequently, but with lower variance. * */ - best_of?: number; + batch_size?: 'auto' | number; /** - * Echo back the prompt in addition to the completion + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid + * overfitting. * */ - echo?: boolean; + learning_rate_multiplier?: '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) + * The number of epochs to train the model for. An epoch refers to one full cycle + * through the training dataset. * */ - frequency_penalty?: number; + n_epochs?: 'auto' | number; + }; + /** + * A list of integrations to enable for your fine-tuning job. + */ + integrations?: Array<{ /** - * 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 type of integration to enable. Currently, only "wandb" (Weights and Biases) is supported. * */ - logit_bias?: { - [key: string]: number; - }; + type: 'wandb'; /** - * 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. + * 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. * */ - logprobs?: number; + wandb: { + /** + * 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 display name to set for the run. If not set, we will use the Job ID as the name. + * + */ + name?: string; + /** + * The name of the project that the new run will be created under. + * + */ + project: 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; + }; + }>; + metadata?: Metadata; + method?: FineTuneMethod; + /** + * 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 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; + /** + * 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 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 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; +}; + +export type CreateImageEditRequest = { + /** + * 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 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; + input_fidelity?: ImageInputFidelity; + /** + * 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; + /** + * 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 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; + /** + * 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'; + partial_images?: PartialImages; + /** + * 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; + /** + * 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'; + /** + * 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 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'; + /** + * 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; + /** + * 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 CreateImageRequest = { + /** + * 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. 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'; + /** + * 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'; + /** + * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. + */ + n?: number; + /** + * 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; + /** + * 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'; + partial_images?: PartialImages; + /** + * 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 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 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'; + /** + * 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; + /** + * 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 = { + /** + * A list of files attached to the message, and the tools they should be added to. + */ + attachments?: Array<{ /** - * 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 ID of the file to attach to the message. */ - max_tokens?: number; + file_id?: string; /** - * 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; + * The tools to add this file to. + */ + tools?: Array< + | ({ + type?: 'AssistantToolsCode'; + } & AssistantToolsCode) + | ({ + type?: 'AssistantToolsFileSearchTypeOnly'; + } & AssistantToolsFileSearchTypeOnly) + >; + }>; + content: + | string + | Array< + | ({ + type?: 'MessageContentImageFileObject'; + } & MessageContentImageFileObject) + | ({ + type?: 'MessageContentImageUrlObject'; + } & MessageContentImageUrlObject) + | ({ + type?: 'MessageRequestContentTextObject'; + } & MessageRequestContentTextObject) + >; + metadata?: Metadata; + /** + * 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'; +}; + +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<{ + /** + * A list of the categories, and whether they are flagged or not. + */ + categories: { + /** + * 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 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 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 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 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 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 the input type(s) that the score applies to. + */ + category_applied_input_types: { + /** + * 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 '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 '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/instructions'. + */ + 'self-harm/instructions': 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 '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'>; + }; + /** + * A list of the categories along with their scores as predicted by model. + */ + category_scores: { + /** + * The score for the category 'harassment'. + */ + harassment: number; + /** + * The score for the category 'harassment/threatening'. + */ + 'harassment/threatening': number; + /** + * The score for the category 'hate'. + */ + hate: number; + /** + * The score for the category 'hate/threatening'. + */ + 'hate/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/instructions'. + */ + 'self-harm/instructions': number; + /** + * The score for the category 'self-harm/intent'. + */ + 'self-harm/intent': 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; + }; + /** + * Whether any of the below categories are flagged. + */ + flagged: boolean; + }>; +}; + +export type CreateResponse = CreateModelResponseProperties & + ResponseProperties & { /** - * 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) + * 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). * */ - presence_penalty?: number; + include?: Array; /** - * 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. + * Text, image, or file inputs to the model, used to generate a response. * - */ - 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). + * 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) * */ - stream?: boolean; - stream_options?: ChatCompletionStreamOptions; + input?: string | Array; /** - * The suffix that comes after a completion of inserted text. + * A system (or developer) message inserted into the model's context. * - * This parameter is only supported for `gpt-3.5-turbo-instruct`. + * 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. * */ - suffix?: string; + instructions?: 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. + * Whether to allow the model to run tool calls in parallel. * */ - temperature?: number; + parallel_tool_calls?: 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. - * - * We generally recommend altering this or `temperature` but not both. + * Whether to store the generated model response for later retrieval via + * API. * */ - top_p?: number; + store?: boolean; /** - * 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 = { + /** + * 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; + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + */ + assistant_id: string; + /** + * 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; + /** + * 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; + /** + * 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; + metadata?: Metadata; + /** + * 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; + parallel_tool_calls?: ParallelToolCalls; + reasoning_effort?: ReasoningEffort; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + /** + * 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; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + /** + * 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; + truncation_strategy?: TruncationObject & unknown; +}; + +export type CreateSpeechRequest = { + /** + * 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; + /** + * 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 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'; + /** + * 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; +}; + +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; + /** + * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + */ + instructions?: string; + /** + * 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; + /** + * 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; + metadata?: Metadata; + /** + * 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'; + parallel_tool_calls?: ParallelToolCalls; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + /** + * 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; + thread?: CreateThreadRequest; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + /** + * 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; + }; + }; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + /** + * 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; + truncation_strategy?: TruncationObject & unknown; }; /** - * 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<{ +export type CreateThreadRequest = { + /** + * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. + */ + messages?: Array; + metadata?: Metadata; + /** + * 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<{ + /** + * The chunking strategy used to chunk the file(s). If not set, will use the `auto` strategy. + */ + chunking_strategy?: + | { + /** + * Always `auto`. + */ + type: 'auto'; + } + | { + static: { + /** + * 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; + }; + /** + * Always `static`. + */ + type: 'static'; + }; /** - * 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. + * 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. * */ - 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; + file_ids?: Array; + metadata?: Metadata; + }>; + }; + }; }; -export type CreateContainerBody = { - /** - * Name of the container to create. - */ - name: string; +export type CreateTranscriptionRequest = { + chunking_strategy?: TranscriptionChunkingStrategy; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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'; + /** + * 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; + /** + * 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; + /** + * 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; + /** + * 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'>; +}; + +/** + * Represents a transcription response returned by model, based on the provided input. + */ +export type CreateTranscriptionResponseJson = { + /** + * 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<{ /** - * IDs of files to copy to the container. + * The bytes of the token. */ - file_ids?: Array; + bytes?: Array; /** - * Container expiration time in seconds relative to the 'anchor' time. + * The log probability of the token. */ - expires_after?: { - /** - * Time anchor for the expiration time. Currently only 'last_active_at' is supported. - */ - anchor: 'last_active_at'; - minutes: number; - }; + logprob?: number; + /** + * The token in the transcription. + */ + token?: string; + }>; + /** + * The transcribed text. + */ + text: string; + /** + * 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 duration of the input audio. + */ + duration: number; + /** + * The language of the input audio. + */ + language: string; + /** + * Segments of the transcribed text and their corresponding details. + */ + segments?: Array; + /** + * The transcribed text. + */ + text: string; + usage?: TranscriptTextUsageDuration; + /** + * Extracted words and their corresponding timestamps. + */ + words?: Array; }; -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 duration of the input audio. + */ + duration: number; + /** + * The language of the output translation (always `english`). + */ + language: string; + /** + * Segments of the translated text and their corresponding details. + */ + segments?: Array; + /** + * The translated text. + */ + text: string; +}; + +export type CreateUploadRequest = { + /** + * The number of bytes in the file you are uploading. + * + */ + bytes: number; + expires_after?: FileExpirationAfter; + /** + * The name of the file to upload. + * + */ + filename: string; + /** + * 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; + /** + * 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'; +}; + +export type CreateVectorStoreFileBatchRequest = { + attributes?: VectorStoreFileAttributes; + chunking_strategy?: ChunkingStrategyRequestParam; + /** + * 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; +}; + +export type CreateVectorStoreFileRequest = { + attributes?: VectorStoreFileAttributes; + chunking_strategy?: ChunkingStrategyRequestParam; + /** + * 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; +}; + +export type CreateVectorStoreRequest = { + chunking_strategy?: ChunkingStrategyRequestParam; + expires_after?: VectorStoreExpirationAfter; + /** + * 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; + metadata?: Metadata; + /** + * The name of the vector store. + */ + name?: string; }; /** - * 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 = { + /** + * 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. + * The grammar definition. */ - seed?: number; + definition: string; /** - * 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 syntax of the grammar definition. One of `lark` or `regex`. */ - response_format?: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject; + syntax: 'lark' | 'regex'; /** - * 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. - * + * Grammar format. Always `grammar`. */ - 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); + type: 'grammar'; + }; + /** + * The name of the custom tool, used to identify it in tool calls. + */ + name: string; + /** + * The type of the custom tool. Always `custom`. + */ + type: 'custom'; }; /** - * 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 = { + /** + * An identifier used to map this custom tool call to a tool call output. + * + */ + call_id: string; + /** + * The unique ID of the custom tool call in the OpenAI platform. + * + */ + id?: string; + /** + * The input for the custom tool call generated by the model. + * + */ + input: string; + /** + * The name of the custom tool being called. + * + */ + name: string; + /** + * The type of the custom tool call. Always `custom_tool_call`. + * + */ + type: 'custom_tool_call'; }; /** - * 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 call ID, used to map this custom tool call output to a custom tool call. + * + */ + call_id: string; + /** + * The unique ID of the custom tool call output in the OpenAI platform. + * + */ + id?: string; + /** + * The output from the custom tool call generated by your code. + * + */ + output: string; + /** + * The type of the custom tool call output. Always `custom_tool_call_output`. + * + */ + type: 'custom_tool_call_output'; }; /** - * 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'; - /** - * The name of the grader. - */ - name: string; - /** - * The model to use for the evaluation. Must support structured outputs. - */ - model: string; +export type CustomToolChatCompletions = { + /** + * Custom tool properties + * + * Properties of the custom tool. + * + */ + custom: { /** - * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + * Optional description of the custom tool, used to provide more context. + * */ - input: Array; + description?: string; /** - * The labels to classify to each item in the evaluation. + * The input format for the custom tool. Default is unconstrained text. + * */ - labels: Array; + format?: + | { + /** + * Unconstrained text format. Always `text`. + */ + type: 'text'; + } + | { + /** + * 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'; + }; + /** + * Grammar format. Always `grammar`. + */ + type: 'grammar'; + }; /** - * The labels that indicate a passing result. Must be a subset of labels. + * The name of the custom tool, used to identify it in tool calls. */ - passing_labels: Array; + name: string; + }; + /** + * The type of the custom tool. Always `custom`. + */ + type: 'custom'; +}; + +export type DeleteAssistantResponse = { + deleted: boolean; + id: string; + object: 'assistant.deleted'; +}; + +export type DeleteCertificateResponse = { + /** + * The ID of the certificate that was deleted. + */ + id: string; + /** + * The object type, must be `certificate.deleted`. + */ + object: 'certificate.deleted'; +}; + +export type DeleteFileResponse = { + deleted: boolean; + id: string; + object: 'file'; +}; + +export type DeleteFineTuningCheckpointPermissionResponse = { + /** + * Whether the fine-tuned model checkpoint permission was successfully deleted. + */ + deleted: boolean; + /** + * 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'; +}; + +export type DeleteMessageResponse = { + deleted: boolean; + id: string; + object: 'thread.message.deleted'; +}; + +export type DeleteModelResponse = { + deleted: boolean; + id: string; + object: string; +}; + +export type DeleteThreadResponse = { + deleted: boolean; + id: string; + object: 'thread.deleted'; +}; + +export type DeleteVectorStoreFileResponse = { + deleted: boolean; + id: string; + object: 'vector_store.file.deleted'; +}; + +export type DeleteVectorStoreResponse = { + deleted: boolean; + id: string; + object: 'vector_store.deleted'; }; /** - * LogsDataSourceConfig + * Occurs when a stream ends. + */ +export type DoneEvent = { + data: '[DONE]'; + event: '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 = { + /** + * 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; + /** + * Specifies the event type. For a drag action, this property is + * always set to `drag`. + * + */ + type: 'drag'; }; /** - * 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 = { + /** + * Text, image, or audio input to the model, used to generate a response. + * Can also contain previous assistant responses. + * + */ + content: string | InputMessageContentList; + /** + * The role of the message input. One of `user`, `assistant`, `system`, or + * `developer`. + * + */ + role: 'user' | 'assistant' | 'system' | 'developer'; + /** + * The type of the message input. Always `message`. + * + */ + type?: 'message'; +}; + +/** + * Represents an embedding vector returned by embedding endpoint. + * + */ +export type Embedding = { + /** + * 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 index of the embedding in the list of embeddings. + */ + index: number; + /** + * 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 = { + data: Error; + event: '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 Unix timestamp (in seconds) for when the eval was created. + */ + created_at: number; + /** + * Configuration of data sources used in runs of the evaluation. + */ + data_source_config: + | ({ + type?: 'EvalCustomDataSourceConfig'; + } & EvalCustomDataSourceConfig) + | ({ + type?: 'EvalLogsDataSourceConfig'; + } & EvalLogsDataSourceConfig) + | ({ + type?: 'EvalStoredCompletionsDataSourceConfig'; + } & EvalStoredCompletionsDataSourceConfig); + /** + * Unique identifier for the evaluation. + */ + id: string; + metadata: Metadata; + /** + * The name of the evaluation. + */ + name: string; + /** + * The object type. + */ + object: 'eval'; + /** + * A list of testing criteria. + */ + testing_criteria: Array< + | EvalGraderLabelModel + | EvalGraderStringCheck + | EvalGraderTextSimilarity + | EvalGraderPython + | EvalGraderScoreModel + >; +}; + +/** + * 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 json schema for the run data source items. + * Learn how to build JSON schemas [here](https://json-schema.org/). + * + */ + schema: { + [key: string]: unknown; + }; + /** + * The type of data source. Always `custom`. + */ + type: 'custom'; +}; + +/** + * 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 = { + /** + * Inputs to the model - can contain template strings. + * + */ + content: + | string + | InputTextContent + | { /** - * The maximum number of tokens in the generated output. + * The text output from the model. + * */ - max_completion_tokens?: number; + text: string; /** - * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + * The type of the output text. Always `output_text`. + * */ - top_p?: number; + type: 'output_text'; + } + | { /** - * A seed value to initialize the randomness, during sampling. + * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + * */ - seed?: number; + detail?: string; /** - * 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 type of the image input. Always `input_image`. * */ - text?: { - format?: TextResponseFormatConfiguration; - }; + type: 'input_image'; + } + | Array; + /** + * The role of the message input. One of `user`, `assistant`, `system`, or + * `developer`. + * + */ + role: 'user' | 'assistant' | 'system' | 'developer'; + /** + * The type of the message input. Always `message`. + * + */ + type?: 'message'; +}; + +/** + * EvalJsonlFileContentSource + */ +export type EvalJsonlFileContentSource = { + /** + * 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; + }; + }>; + /** + * The type of jsonl source. Always `file_content`. + */ + type: 'file_content'; }; /** - * 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 identifier of the file. + */ + id: string; + /** + * The type of jsonl source. Always `file_id`. + */ + type: 'file_id'; }; /** - * StoredCompletionsDataSourceConfig + * EvalList * - * Deprecated in favor of LogsDataSourceConfig. + * An object representing a list of evals. + * + */ +export type EvalList = { + /** + * An array of eval objects. + * + */ + data: Array; + /** + * The identifier of the first eval in the data array. + */ + first_id: string; + /** + * Indicates whether there are more evals available. + */ + has_more: boolean; + /** + * The identifier of the last eval in the data array. + */ + last_id: string; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; +}; + +/** + * 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 = { + 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; + }; + /** + * The type of data source. Always `logs`. + */ + type: 'logs'; +}; + +/** + * EvalResponsesSource + * + * A EvalResponsesSource object describing a run data source configuration. + * + */ +export type EvalResponsesSource = { + /** + * 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 string to search the 'instructions' field. This is a query parameter used to select responses. + */ + instructions_search?: string; + /** + * 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 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; + /** + * List of tool names. This is a query parameter used to select responses. + */ + tools?: Array; + /** + * Nucleus sampling parameter. This is a query parameter used to select responses. + */ + top_p?: number; + /** + * The type of run data source. Always `responses`. + */ + type: 'responses'; + /** + * List of user identifiers. This is a query parameter used to select responses. + */ + users?: Array; +}; + +/** + * EvalRun + * + * A schema representing an evaluation run. + * + */ +export type EvalRun = { + /** + * Unix timestamp (in seconds) when the evaluation run was created. + */ + created_at: number; + /** + * Information about the run's data source. + */ + data_source: + | ({ + type?: 'CreateEvalJsonlRunDataSource'; + } & CreateEvalJsonlRunDataSource) + | ({ + type?: 'CreateEvalCompletionsRunDataSource'; + } & CreateEvalCompletionsRunDataSource) + | ({ + type?: 'CreateEvalResponsesRunDataSource'; + } & CreateEvalResponsesRunDataSource); + error: EvalApiError; + /** + * The identifier of the associated evaluation. + */ + eval_id: string; + /** + * Unique identifier for the evaluation run. + */ + id: string; + metadata: Metadata; + /** + * The model that is evaluated, if applicable. + */ + model: string; + /** + * The name of the evaluation run. + */ + name: string; + /** + * The type of the object. Always "eval.run". + */ + object: 'eval.run'; + /** + * Usage statistics for each model during the evaluation run. + */ + per_model_usage: Array<{ + /** + * The number of tokens retrieved from cache. + */ + cached_tokens: number; + /** + * The number of completion tokens generated. + */ + completion_tokens: number; /** - * The type of data source. Always `stored_completions`. + * The number of invocations. */ - type: 'stored_completions'; + invocation_count: number; /** - * Metadata filters for the stored completions data source. + * The name of the model. */ - metadata?: { - [key: string]: unknown; - }; -}; - -export type CreateFileRequest = { + model_name: string; /** - * The File object (not file name) to be uploaded. - * + * The number of prompt tokens used. */ - file: Blob | File; - purpose: FilePurpose; - expires_after?: FileExpirationAfter; -}; - -export type CreateFineTuningCheckpointPermissionRequest = { + prompt_tokens: number; /** - * The project identifiers to grant access to. + * The total number of tokens used. */ - project_ids: Array; -}; - -export type CreateFineTuningJobRequest = { + total_tokens: number; + }>; + /** + * Results per testing criteria applied during the evaluation run. + */ + per_testing_criteria_results: Array<{ /** - * 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). - * + * Number of tests failed for this criteria. */ - model: string | 'babbage-002' | 'davinci-002' | 'gpt-3.5-turbo' | 'gpt-4o-mini'; + failed: 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. - * + * Number of tests passed for this criteria. */ - training_file: string; + passed: 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 + * A description of the testing criteria. */ - 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; - }; + testing_criteria: string; + }>; + /** + * 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: { /** - * 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`. - * + * Number of output items that resulted in an error. */ - suffix?: string; + errored: 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. - * + * Number of output items that failed to pass the evaluation. */ - validation_file?: string; + failed: number; /** - * A list of integrations to enable for your fine-tuning job. + * Number of output items that passed the evaluation. */ - 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; - }; - }>; + passed: number; /** - * 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. - * + * Total number of executed output items. */ - seed?: number; - method?: FineTuneMethod; - metadata?: Metadata; + total: number; + }; + /** + * The status of the evaluation run. + */ + status: string; }; -export type CreateImageEditRequest = { +/** + * EvalRunList + * + * An object representing a list of runs for an evaluation. + * + */ +export type EvalRunList = { + /** + * An array of eval run objects. + * + */ + data: Array; + /** + * The identifier of the first eval run in the data array. + */ + first_id: string; + /** + * Indicates whether there are more evals available. + */ + has_more: boolean; + /** + * The identifier of the last eval run in the data array. + */ + last_id: string; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; +}; + +/** + * EvalRunOutputItem + * + * A schema representing an evaluation run output item. + * + */ +export type EvalRunOutputItem = { + /** + * Unix timestamp (in seconds) when the evaluation run was created. + */ + created_at: number; + /** + * Details of the input data source item. + */ + datasource_item: { + [key: string]: unknown; + }; + /** + * The identifier for the data source item. + */ + datasource_item_id: number; + /** + * The identifier of the evaluation group. + */ + eval_id: string; + /** + * Unique identifier for the evaluation run output item. + */ + id: string; + /** + * The type of the object. Always "eval.run.output_item". + */ + object: 'eval.run.output_item'; + /** + * A list of results from the evaluation run. + */ + results: Array<{ + [key: string]: unknown; + }>; + /** + * The identifier of the evaluation run associated with this output item. + */ + run_id: string; + /** + * A sample containing the input and output of the evaluation run. + */ + sample: { + error: EvalApiError; /** - * 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. - * + * The reason why the sample generation was finished. */ - image: Blob | File | Array; + finish_reason: 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`. + * An array of input messages. */ - prompt: string; + input: Array<{ + /** + * The content of the message. + */ + content: string; + /** + * The role of the message sender (e.g., system, user, developer). + */ + role: 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 maximum number of tokens allowed for completion. */ - mask?: Blob | File; + max_completion_tokens: 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. - * - * If `transparent`, the output format needs to support transparency, so it - * should be set to either `png` (default value) or `webp`. - * + * The model used for generating the sample. */ - background?: 'transparent' | 'opaque' | 'auto'; + model: string; /** - * 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'; + * An array of output messages. + */ + output: Array<{ + /** + * The content of the message. + */ + content?: string; + /** + * The role of the message (e.g. "system", "assistant", "user"). + */ + role?: string; + }>; /** - * The number of images to generate. Must be between 1 and 10. + * The seed used for generating the sample. */ - n?: number; + seed: 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 sampling temperature used. */ - size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto'; + temperature: 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 top_p value used for sampling. */ - response_format?: 'url' | 'b64_json'; + top_p: number; /** - * 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`. - * + * Token usage details for the sample. */ - output_format?: 'png' | 'jpeg' | 'webp'; + usage: { + /** + * The number of tokens retrieved from cache. + */ + cached_tokens: number; + /** + * The number of completion tokens generated. + */ + completion_tokens: number; + /** + * The number of prompt tokens used. + */ + prompt_tokens: number; + /** + * The total number of tokens used. + */ + total_tokens: number; + }; + }; + /** + * The status of the evaluation run. + */ + status: string; +}; + +/** + * EvalRunOutputItemList + * + * An object representing a list of output items for an evaluation run. + * + */ +export type EvalRunOutputItemList = { + /** + * 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; + /** + * Indicates whether there are more eval run output items available. + */ + has_more: boolean; + /** + * The identifier of the last eval run output item in the data array. + */ + last_id: string; + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; +}; + +/** + * StoredCompletionsDataSourceConfig + * + * Deprecated in favor of LogsDataSourceConfig. + * + * + * @deprecated + */ +export type EvalStoredCompletionsDataSourceConfig = { + 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; + }; + /** + * The type of data source. Always `stored_completions`. + */ + type: 'stored_completions'; +}; + +/** + * StoredCompletionsRunDataSource + * + * A StoredCompletionsRunDataSource configuration describing a set of filters + * + */ +export type EvalStoredCompletionsSource = { + /** + * 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; + metadata?: Metadata; + /** + * An optional model to filter by (e.g., 'gpt-4o'). + */ + model?: string; + /** + * The type of source. Always `stored_completions`. + */ + type: 'stored_completions'; +}; + +/** + * 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 ID of the file. + * + */ + file_id: string; + /** + * The index of the file in the list of files. + * + */ + index: number; + /** + * The type of the file path. Always `file_path`. + * + */ + type: 'file_path'; +}; + +/** + * 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 queries used to search for files. + * + */ + queries: Array; + /** + * The results of the file search tool call. + * + */ + results?: Array<{ + attributes?: VectorStoreFileAttributes; /** - * 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 unique ID of the file. * */ - output_compression?: number; + file_id?: 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; /** - * 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; /** - * 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`. + * The text that was retrieved from the file. * */ - quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto'; + text?: string; + }>; + /** + * The status of the file search tool call. One of `in_progress`, + * `searching`, `incomplete` or `failed`, + * + */ + status: 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed'; + /** + * The type of the file search tool call. Always `file_search_call`. + * + */ + type: 'file_search_call'; }; -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'; +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 = { + /** + * A list of functions the model may generate JSON inputs for. + * + * @deprecated + */ + functions?: Array; + messages?: Array< + | ChatCompletionRequestSystemMessage + | ChatCompletionRequestUserMessage + | FineTuneChatCompletionRequestAssistantMessage + | ChatCompletionRequestToolMessage + | ChatCompletionRequestFunctionMessage + >; + parallel_tool_calls?: ParallelToolCalls; + /** + * A list of tools the model may generate JSON inputs for. + */ + tools?: Array; +}; + +/** + * The hyperparameters used for the DPO fine-tuning job. + */ +export type FineTuneDpoHyperparameters = { + /** + * 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; + /** + * 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; + /** + * 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 = { + dpo?: FineTuneDpoMethod; + reinforcement?: FineTuneReinforcementMethod; + supervised?: FineTuneSupervisedMethod; + /** + * The type of method. Is either `supervised`, `dpo`, or `reinforcement`. + */ + type: 'supervised' | 'dpo' | 'reinforcement'; +}; + +/** + * 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 + >; + parallel_tool_calls?: ParallelToolCalls; /** - * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. + * A list of tools the model may generate JSON inputs for. */ - n?: number; + tools?: Array; + }; + /** + * The non-preferred completion message for the output. + */ + non_preferred_output?: Array; + /** + * The preferred completion message for the output. + */ + 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; + /** + * 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; + /** + * 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'; +}; + +/** + * 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 Unix timestamp (in seconds) for when the permission was created. + */ + created_at: number; + /** + * The permission identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * The object type, which is always "checkpoint.permission". + */ + object: 'checkpoint.permission'; + /** + * The project identifier that the permission is for. + */ + project_id: string; +}; + +/** + * 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 quality of the image that will be generated. + * 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. * - * - `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'; + entity?: 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 display name to set for the run. If not set, we will use the Job ID as the name. + * */ - output_format?: 'png' | 'jpeg' | 'webp'; + name?: 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 name of the project that the new run will be created under. + * */ - output_compression?: number; + project: string; /** - * 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`. + * 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}". * */ - stream?: boolean; - partial_images?: PartialImages; + tags?: Array; + }; +}; + +/** + * FineTuningJob + * + * The `fine_tuning.job` object represents a fine-tuning job that has been created through the API. + * + */ +export type FineTuningJob = { + /** + * 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: { /** - * 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`. + * A machine-readable error code. */ - size?: 'auto' | '1024x1024' | '1536x1024' | '1024x1536' | '256x256' | '512x512' | '1792x1024' | '1024x1792'; + code: string; /** - * Control the content-moderation level for images generated by `gpt-image-1`. Must be either `low` for less restrictive filtering or `auto` (default value). + * A human-readable error message. */ - moderation?: 'low' | 'auto'; + message: 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`. + * 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 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; + /** + * 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. * */ - background?: 'transparent' | 'opaque' | 'auto'; + batch_size?: 'auto' | number; /** - * 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. + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid + * overfitting. + * */ - 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 object identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * A list of integrations to enable for this fine-tuning job. + */ + integrations?: Array< + { + type?: 'FineTuningIntegration'; + } & FineTuningIntegration + >; + metadata?: Metadata; + method?: FineTuneMethod; + /** + * 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 seed used for the fine-tuning job. + */ + seed: number; + /** + * 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; }; /** @@ -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 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 name of the fine-tuning job that this checkpoint was created from. + */ + fine_tuning_job_id: string; + /** + * The checkpoint identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * Metrics at the step number during the fine-tuning job. + */ + metrics: { + full_valid_loss?: number; + full_valid_mean_token_accuracy?: number; + step?: number; + train_loss?: number; + train_mean_token_accuracy?: number; + valid_loss?: number; + valid_mean_token_accuracy?: number; + }; + /** + * The object type, which is always "fine_tuning.job.checkpoint". + */ + object: 'fine_tuning.job.checkpoint'; + /** + * The step number that the checkpoint was created at. + */ + step_number: number; }; /** * 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 Unix timestamp (in seconds) for when the fine-tuning job was created. + */ + created_at: number; + /** + * The data associated with the event. + */ + data?: { + [key: string]: unknown; + }; + /** + * The object identifier. + */ + id: string; + /** + * The log level of the event. + */ + level: 'info' | 'warn' | 'error'; + /** + * The message of the event. + */ + message: string; + /** + * The object type, which is always "fine_tuning.job.event". + */ + object: 'fine_tuning.job.event'; + /** + * The type of event. + */ + type?: 'message' | 'metrics'; }; 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'; + /** + * A JSON string of the arguments to pass to the function. + * + */ + arguments: string; + /** + * The unique ID of the function tool call generated by the model. + * + */ + call_id: string; + /** + * The unique ID of the function tool call. + * + */ + id?: string; + /** + * The name of the function to run. + * + */ + name: 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 type of the function tool call. Always `function_call`. + * + */ + type: 'function_call'; }; /** @@ -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 generated by the model. + * + */ + call_id: string; + /** + * The unique ID of the function tool call output. Populated when this item + * is returned via API. + * + */ + 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 type of the function tool call output. Always `function_call_output`. + * + */ + type: 'function_call_output'; }; 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; + input: Array; + /** + * The labels to assign to each item in the evaluation. + */ + labels: Array; + /** + * The model to use for the evaluation. Must support structured outputs. + */ + model: string; + /** + * The name of the grader. + */ + name: string; + /** + * 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'; }; /** @@ -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; + /** + * A formula to calculate the output based on grader results. + */ + calculate_output: string; + graders: + | GraderStringCheck + | GraderTextSimilarity + | GraderPython + | GraderScoreModel + | GraderLabelModel; + /** + * The name of the grader. + */ + name: string; + /** + * The object type, which is always `multi`. + */ + type: 'multi'; }; /** @@ -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 image tag to use for the python script. + */ + image_tag?: string; + /** + * The name of the grader. + */ + name: string; + /** + * The source code of the python script. + */ + source: string; + /** + * The object type, which is always `python`. + */ + type: 'python'; }; /** @@ -6654,33 +6889,33 @@ export type GraderPython = { * A ScoreModelGrader object that uses a model to assign a score to the input. * */ -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; +export type GraderScoreModel = { + /** + * The input text. This may include template strings. + */ + input: Array; + /** + * The model to use for the evaluation. + */ + model: string; + /** + * The name of the grader. + */ + name: string; + /** + * The range of the score. Defaults to `[0, 1]`. + */ + range?: Array; + /** + * The sampling parameters for the model. + */ + sampling_params?: { + [key: string]: unknown; + }; + /** + * The object type, which is always `score_model`. + */ + type: 'score_model'; }; /** @@ -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 input text. This may include template strings. + */ + input: string; + /** + * The name of the grader. + */ + name: string; + /** + * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + */ + operation: 'eq' | 'ne' | 'like' | 'ilike'; + /** + * The reference text. This may include template strings. + */ + reference: string; + /** + * The object type, which is always `string_check`. + */ + type: 'string_check'; }; /** @@ -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 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 text being graded. + */ + input: string; + /** + * The name of the grader. + */ + name: string; + /** + * The text being graded against. + */ + reference: string; + /** + * The type of grader. + */ + type: 'text_similarity'; }; /** * 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; + /** + * For `dall-e-3` only, the revised prompt that was used to generate the image. + */ + revised_prompt?: 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; }; /** @@ -6767,42 +7013,42 @@ 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; + /** + * Base64-encoded final edited image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The background setting for the edited image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The output format for the edited image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + /** + * The quality setting for the edited image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The size of the edited image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The type of the event. Always `image_edit.completed`. + * + */ + type: 'image_edit.completed'; + usage: ImagesUsage; }; /** @@ -6810,95 +7056,97 @@ export type 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); + /** + * Base64-encoded partial image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The background setting for the requested edited image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * 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; + /** + * The quality setting for the requested edited image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The size of the requested edited image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The type of the event. Always `image_edit.partial_image`. + * + */ + type: 'image_edit.partial_image'; +}; + +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; + /** + * Base64-encoded image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The background setting for the generated image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The output format for the generated image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + /** + * The quality setting for the generated image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The size of the generated image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The type of the event. Always `image_generation.completed`. + * + */ + type: 'image_generation.completed'; + 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); + /** + * Base64-encoded partial image data, suitable for rendering as an image. + * + */ + b64_json: string; + /** + * The background setting for the requested image. + * + */ + background: 'transparent' | 'opaque' | 'auto'; + /** + * The Unix timestamp when the event was created. + * + */ + created_at: number; + /** + * The output format for the requested image. + * + */ + output_format: 'png' | 'webp' | 'jpeg'; + /** + * 0-based index for the partial image (streaming). + * + */ + partial_image_index: number; + /** + * The quality setting for the requested image. + * + */ + quality: 'low' | 'medium' | 'high' | 'auto'; + /** + * The size of the requested image. + * + */ + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + /** + * The type of the event. Always `image_generation.partial_image`. + * + */ + type: 'image_generation.partial_image'; +}; + +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`. - * - */ - background?: 'transparent' | 'opaque' | 'auto'; - input_fidelity?: ImageInputFidelity; - /** - * Optional mask for inpainting. Contains `image_url` - * (string, optional) and `file_id` (string, optional). + /** + * 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?: { + /** + * File ID for the mask image. * */ - input_image_mask?: { - /** - * Base64-encoded mask image. - * - */ - image_url?: string; - /** - * File ID for the mask image. - * - */ - file_id?: string; - }; + file_id?: string; /** - * Number of partial images to generate in streaming mode, from 0 (default value) to 3. + * Base64-encoded mask image. * */ - partial_images?: number; + image_url?: string; + }; + /** + * The image generation model to use. Default: `gpt-image-1`. + * + */ + model?: 'gpt-image-1'; + /** + * Moderation level for the generated image. Default: `auto`. + * + */ + moderation?: 'auto' | 'low'; + /** + * Compression level for the output image. Default: 100. + * + */ + output_compression?: number; + /** + * The output format of the generated image. One of `png`, `webp`, or + * `jpeg`. Default: `png`. + * + */ + output_format?: 'png' | 'webp' | 'jpeg'; + /** + * Number of partial images to generate in streaming mode, from 0 (default value) to 3. + * + */ + partial_images?: number; + /** + * 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 type of the image generation tool. Always `image_generation`. + * + */ + type: 'image_generation'; }; /** @@ -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 unique ID of the image generation call. + * + */ + id: string; + /** + * The generated image encoded in base64. + * + */ + result: string; + /** + * The status of the image generation call. + * + */ + status: 'in_progress' | 'completed' | 'generating' | 'failed'; + /** + * The type of the image generation call. Always `image_generation_call`. + * + */ + type: 'image_generation_call'; }; /** @@ -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 background parameter used for the image generation. Either `transparent` or `opaque`. + */ + background?: 'transparent' | 'opaque'; + /** + * The Unix timestamp (in seconds) of when the image was created. + */ + created: number; + /** + * The list of generated images. + */ + data?: Array; + /** + * The output format of the image generation. Either `png`, `webp`, or `jpeg`. + */ + output_format?: 'png' | 'webp' | 'jpeg'; + /** + * The quality of the image generated. Either `low`, `medium`, or `high`. + */ + quality?: 'low' | 'medium' | 'high'; + /** + * The size of the image generated. Either `1024x1024`, `1024x1536`, or `1536x1024`. + */ + size?: '1024x1024' | '1024x1536' | '1536x1024'; + usage?: ImageGenUsage; }; /** @@ -7113,32 +7363,32 @@ export type ImagesResponse = { * */ export type ImagesUsage = { + /** + * The number of tokens (images and text) in the input prompt. + */ + input_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 image tokens in the input prompt. */ - output_tokens: number; + image_tokens: number; /** - * The input tokens detailed information for the image generation. + * The number of text 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; - }; + text_tokens: number; + }; + /** + * The number of image tokens in the output image. + */ + output_tokens: number; + /** + * The total number of tokens (images and text) used for the image generation. + * + */ + total_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); + /** + * Base64-encoded audio data. + * + */ + data: string; + /** + * The format of the audio data. Currently supported formats are `mp3` and + * `wav`. + * + */ + format: 'mp3' | 'wav'; + /** + * The type of the input item. Always `input_audio`. + * + */ + type: 'input_audio'; +}; + +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; + content: InputMessageContentList; + /** + * 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'; + /** + * The type of the message input. Always set to `message`. + * + */ + type?: 'message'; }; /** @@ -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. +/** + * Represents an individual `invite` to the organization. + */ +export type Invite = { + /** + * The Unix timestamp (in seconds) of when the invite was accepted. + */ + accepted_at?: number; + /** + * The email address of the individual to whom the invite was sent + */ + email: string; + /** + * The Unix timestamp (in seconds) of when the invite expires. + */ + expires_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The Unix timestamp (in seconds) of when the invite was sent. + */ + invited_at: number; + /** + * The object type, which is always `organization.invite` + */ + object: 'organization.invite'; + /** + * 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'; + }>; + /** + * `owner` or `reader` + */ + role: 'owner' | 'reader'; + /** + * `accepted`,`expired`, or `pending` + */ + status: 'accepted' | 'expired' | 'pending'; }; export type InviteDeleteResponse = { - /** - * The object type, which is always `organization.invite.deleted` - */ - object: 'organization.invite.deleted'; - id: string; - deleted: boolean; + deleted: boolean; + id: string; + /** + * The object type, which is always `organization.invite.deleted` + */ + object: 'organization.invite.deleted'; }; 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; + data: Array; + /** + * The first `invite_id` in the retrieved `list` + */ + first_id?: string; + /** + * The `has_more` property is used for pagination to indicate there are additional results. + */ + has_more?: boolean; + /** + * The last `invite_id` in the retrieved `list` + */ + last_id?: string; + /** + * The object type, which is always `list` + */ + object: 'list'; }; export type InviteRequest = { + /** + * Send an email to this address + */ + email: 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. + */ + projects?: Array<{ /** - * Send an email to this address - */ - email: string; - /** - * `owner` or `reader` + * 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'; + }>; + /** + * `owner` or `reader` + */ + role: 'reader' | '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; + /** + * 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'; }; export type ListAssistantsResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; export type ListAuditLogsResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: 'list'; }; export type ListBatchesResponse = { - data: Array; - first_id?: string; - last_id?: string; - has_more: boolean; - object: 'list'; + data: Array; + first_id?: string; + has_more: boolean; + last_id?: string; + object: 'list'; }; export type ListCertificatesResponse = { - data: Array; - first_id?: string; - last_id?: string; - has_more: boolean; - object: 'list'; + data: Array; + first_id?: string; + has_more: boolean; + last_id?: string; + object: 'list'; }; export type ListFilesResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; export type ListFineTuningCheckpointPermissionResponse = { - data: Array; - object: 'list'; - first_id?: string; - last_id?: string; - has_more: boolean; + data: Array; + first_id?: string; + has_more: boolean; + last_id?: string; + object: 'list'; }; export type ListFineTuningJobCheckpointsResponse = { - data: Array; - object: 'list'; - first_id?: string; - last_id?: string; - has_more: boolean; + data: Array; + first_id?: string; + has_more: boolean; + last_id?: string; + object: 'list'; }; export type ListFineTuningJobEventsResponse = { - data: Array; - object: 'list'; - has_more: boolean; + data: Array; + has_more: boolean; + object: 'list'; }; export type ListMessagesResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; export type ListModelsResponse = { - object: 'list'; - data: Array; + data: Array; + object: 'list'; }; 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; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; export type ListRunsResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; export type ListVectorStoreFilesResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; export type ListVectorStoresResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; /** @@ -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 command to run. + * + */ + command: Array; + /** + * Environment variables to set for the command. + * + */ + env: { + [key: string]: string; + }; + /** + * Optional timeout in milliseconds for the command. + * + */ + timeout_ms?: number; + /** + * The type of the local shell action. Always `exec`. + * + */ + type: 'exec'; + /** + * Optional user to run the command as. + * + */ + user?: string; + /** + * Optional working directory to run the command in. + * + */ + working_directory?: string; }; /** @@ -7640,10 +7931,10 @@ export type LocalShellExecAction = { * */ export type LocalShellTool = { - /** - * The type of the local shell tool. Always `local_shell`. - */ - type: 'local_shell'; + /** + * The type of the local shell tool. Always `local_shell`. + */ + type: 'local_shell'; }; /** @@ -7653,27 +7944,27 @@ export type LocalShellTool = { * */ 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'; + action: LocalShellExecAction; + /** + * The unique ID of the local shell tool call generated by the model. + * + */ + call_id: string; + /** + * The unique ID of the local shell call. + * + */ + id: string; + /** + * The status of the local shell call. + * + */ + status: 'in_progress' | 'completed' | 'incomplete'; + /** + * The type of the local shell call. Always `local_shell_call`. + * + */ + type: 'local_shell_call'; }; /** @@ -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 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'; }; /** @@ -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 bytes that were used to generate the log probability. + * + */ + bytes: Array; + /** + * The log probability of the token. + * + */ + logprob: number; + /** + * The token that was used to generate the log probability. + * + */ + token: string; }; /** @@ -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; + /** + * A JSON string of arguments for the tool. + * + */ + arguments: string; + /** + * The unique ID of the approval request. + * + */ + id: string; + /** + * The name of the tool to run. + * + */ + name: string; + /** + * The label of the MCP server making the request. + * + */ + server_label: string; + /** + * The type of the item. Always `mcp_approval_request`. + * + */ + type: 'mcp_approval_request'; }; /** @@ -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 ID of the approval request being answered. + * + */ + approval_request_id: string; + /** + * Whether the request was approved. + * + */ + approve: boolean; + /** + * The unique ID of the approval response + * + */ + id?: string; + /** + * Optional reason for the decision. + * + */ + reason?: string; + /** + * The type of the item. Always `mcp_approval_response`. + * + */ + type: 'mcp_approval_response'; }; /** @@ -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 ID of the approval request being answered. + * + */ + approval_request_id: string; + /** + * Whether the request was approved. + * + */ + approve: boolean; + /** + * The unique ID of the approval response + * + */ + id: string; + /** + * Optional reason for the decision. + * + */ + reason?: string; + /** + * The type of the item. Always `mcp_approval_response`. + * + */ + type: 'mcp_approval_response'; }; /** @@ -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; + /** + * Error message if the server could not list tools. + * + */ + error?: string; + /** + * 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; + /** + * The type of the item. Always `mcp_list_tools`. + * + */ + type: 'mcp_list_tools'; }; /** @@ -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; - }; + /** + * Additional annotations about the tool. + * + */ + annotations?: { + [key: string]: unknown; + }; + /** + * The description of the tool. + * + */ + description?: string; + /** + * The JSON schema describing the tool's input. + * + */ + input_schema: { + [key: string]: unknown; + }; + /** + * The name of the tool. + * + */ + name: string; }; /** @@ -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 | { + /** + * 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?: { + }; + /** + * Optional HTTP headers to send to the MCP server. Use for authentication + * or other purposes. + * + */ + headers?: { + [key: string]: string; + }; + /** + * 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'; + /** + * Optional description of the MCP server, used to provide more context. + * + */ + server_description?: string; + /** + * 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; + /** + * The type of the MCP tool. Always `mcp`. + */ + type: 'mcp'; }; /** @@ -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; + /** + * A JSON string of the arguments passed to the tool. + * + */ + arguments: string; + /** + * The error from the tool call, if any. + * + */ + error?: string; + /** + * The unique ID of the tool call. + * + */ + id: string; + /** + * The name of the tool that was run. + * + */ + name: string; + /** + * The output from the tool call. + * + */ + output?: string; + /** + * The label of the MCP server running the tool. + * + */ + server_label: string; + /** + * The type of the item. Always `mcp_call`. + * + */ + type: 'mcp_call'; }; /** @@ -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 = { + image_file: { /** - * 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'; + /** + * 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; + }; + /** + * Always `image_file`. + */ + type: 'image_file'; }; /** @@ -8042,20 +8338,20 @@ export type MessageContentImageFileObject = { * References an image URL in the content of a message. */ export type MessageContentImageUrlObject = { + image_url: { /** - * The type of the content part. + * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. Default value is `auto` */ - 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'; - }; + detail?: 'auto' | 'low' | 'high'; + /** + * The external URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. + */ + url: string; + }; + /** + * The type of the content part. + */ + type: 'image_url'; }; /** @@ -8064,11 +8360,11 @@ export type MessageContentImageUrlObject = { * The refusal content generated by the assistant. */ export type MessageContentRefusalObject = { - /** - * Always `refusal`. - */ - type: 'refusal'; - refusal: string; + refusal: string; + /** + * Always `refusal`. + */ + type: 'refusal'; }; /** @@ -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 = { + end_index: number; + file_citation: { /** - * Always `file_citation`. + * The ID of the specific File the citation is from. */ - 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. - */ - file_id: string; - }; - start_index: number; - end_index: number; + file_id: string; + }; + start_index: number; + /** + * The text in the message content that needs to be replaced. + */ + text: string; + /** + * Always `file_citation`. + */ + type: 'file_citation'; }; /** @@ -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 = { + end_index: number; + file_path: { /** - * Always `file_path`. - */ - type: 'file_path'; - /** - * The text in the message content that needs to be replaced. + * 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; + /** + * The text in the message content that needs to be replaced. + */ + text: string; + /** + * Always `file_path`. + */ + type: 'file_path'; }; /** @@ -8125,17 +8421,17 @@ export type MessageContentTextAnnotationsFilePathObject = { * The text content that is part of a message. */ export type MessageContentTextObject = { + text: { + annotations: Array; /** - * 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; + }; + /** + * Always `text`. + */ + type: 'text'; }; /** @@ -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 = { + image_file?: { /** - * The index of the content part in the message. + * 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`. */ - index: number; + detail?: 'auto' | 'low' | 'high'; /** - * 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; + }; + /** + * The index of the content part in the message. + */ + index: number; + /** + * Always `image_file`. + */ + type: 'image_file'; }; /** @@ -8170,24 +8466,24 @@ export type MessageDeltaContentImageFileObject = { * References an image URL in the content of a message. */ export type MessageDeltaContentImageUrlObject = { + image_url?: { /** - * The index of the content part in the message. + * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. */ - index: number; + detail?: 'auto' | 'low' | 'high'; /** - * Always `image_url`. + * The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. */ - 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'; - }; + url?: string; + }; + /** + * The index of the content part in the message. + */ + index: number; + /** + * Always `image_url`. + */ + type: 'image_url'; }; /** @@ -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; + refusal?: string; + /** + * Always `refusal`. + */ + type: 'refusal'; }; /** @@ -8213,30 +8509,30 @@ 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 = { + end_index?: number; + file_citation?: { /** - * The index of the annotation in the text content part. - */ - index: number; - /** - * Always `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; + }; + /** + * The index of the annotation in the text content part. + */ + index: number; + start_index?: number; + /** + * The text in the message content that needs to be replaced. + */ + text?: string; + /** + * Always `file_citation`. + */ + type: 'file_citation'; }; /** @@ -8245,26 +8541,26 @@ export type MessageDeltaContentTextAnnotationsFileCitationObject = { * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. */ export type MessageDeltaContentTextAnnotationsFilePathObject = { + end_index?: number; + file_path?: { /** - * 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. + * 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; + }; + /** + * The index of the annotation in the text content part. + */ + index: number; + start_index?: number; + /** + * The text in the message content that needs to be replaced. + */ + text?: string; + /** + * Always `file_path`. + */ + type: 'file_path'; }; /** @@ -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; + text?: { + annotations?: Array; /** - * The index of the content part in the message. - */ - index: number; - /** - * 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; + }; + /** + * Always `text`. + */ + type: 'text'; }; /** @@ -8297,27 +8593,27 @@ export type MessageDeltaContentTextObject = { * */ export type MessageDeltaObject = { + /** + * 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 content of the message in array of text and/or images. */ - object: 'thread.message.delta'; + content?: Array; /** - * The delta containing the fields that have changed on the Message. + * The entity that produced the message. One of `user` or `assistant`. */ - 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; - }; + role?: 'user' | 'assistant'; + }; + /** + * 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'; }; /** @@ -8326,73 +8622,73 @@ export type MessageDeltaObject = { * Represents a message within a [thread](https://platform.openai.com/docs/api-reference/threads). */ export type MessageObject = { + /** + * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. + */ + assistant_id: string; + /** + * A list of files attached to the message, and the tools they were added to. + */ + attachments: Array<{ /** - * 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. + * The ID of the file to attach to the 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; + file_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. - */ - file_id?: string; - /** - * The tools to add this file to. - */ - tools?: Array; - }>; - metadata: Metadata; + * The tools to add this file to. + */ + tools?: Array; + }>; + /** + * The Unix timestamp (in seconds) for when the message was completed. + */ + completed_at: number; + /** + * The content of the message in array of text and/or images. + */ + content: Array; + /** + * The Unix timestamp (in seconds) for when the message was created. + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the message was marked as incomplete. + */ + incomplete_at: number; + /** + * 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'; + }; + metadata: Metadata; + /** + * The object type, which is always `thread.message`. + */ + object: 'thread.message'; + /** + * The entity that produced the message. One of `user` or `assistant`. + */ + role: 'user' | 'assistant'; + /** + * 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; + /** + * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + */ + status: 'in_progress' | 'incomplete' | 'completed'; + /** + * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + */ + thread_id: string; }; /** @@ -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; -}; + /** + * Text content to be sent to the model + */ + text: string; + /** + * Always `text`. + */ + type: 'text'; +}; + +export type MessageStreamEvent = + | { + data: MessageObject; + event: 'thread.message.created'; + } + | { + data: MessageObject; + event: 'thread.message.in_progress'; + } + | { + data: MessageDeltaObject; + event: 'thread.message.delta'; + } + | { + data: MessageObject; + event: 'thread.message.completed'; + } + | { + data: MessageObject; + event: 'thread.message.incomplete'; + }; /** * 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 Unix timestamp (in seconds) when the model was created. + */ + created: number; + /** + * The model identifier, which can be referenced in the API endpoints. + */ + id: string; + /** + * 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; + /** + * 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; + /** + * 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; + service_tier?: ServiceTier; + /** + * 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 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; + /** + * 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; }; 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; - }; + /** + * 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; + metadata?: Metadata; + /** + * 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; + reasoning_effort?: ReasoningEffort; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + /** + * 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; + }; + }; + /** + * 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; + /** + * 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; }; 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; - }; + metadata?: Metadata; + /** + * 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; + }; + }; }; /** @@ -8627,70 +8939,78 @@ 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; }; /** * OpenAIFile - * - * 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` object represents a document that has been uploaded to OpenAI. + */ +export type OpenAiFile = { + /** + * 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 file identifier, which can be referenced in the API endpoints. + */ + id: 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); + /** + * Base64-encoded audio data from the model. + * + */ + data: string; + /** + * The transcript of the audio data from the model. + * + */ + transcript: string; + /** + * The type of the output audio. Always `output_audio`. + * + */ + type: 'output_audio'; +}; + +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 content of the output message. + * + */ + content: Array; + /** + * The unique ID of the output message. + * + */ + id: string; + /** + * The role of the output message. Always `assistant`. + * + */ + role: 'assistant'; + /** + * 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 output message. Always `message`. + * + */ + type: 'message'; }; /** @@ -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 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'; }; /** * 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'; + /** + * The Unix timestamp (in seconds) of when the project was archived or `null`. + */ + archived_at?: number; + /** + * The Unix timestamp (in seconds) of when the project was created. + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the project. This appears in reporting. + */ + name: string; + /** + * The object type, which is always `organization.project` + */ + object: 'organization.project'; + /** + * `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 Unix timestamp (in seconds) of when the API key was created + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The Unix timestamp (in seconds) of when the API key was last used. + */ + last_used_at: number; + /** + * The name of the API key + */ + name: string; + /** + * The object type, which is always `organization.project.api_key` + */ + object: 'organization.project.api_key'; + owner: { + service_account?: ProjectServiceAccount; + /** + * `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; + }; + /** + * The redacted value of the API key + */ + redacted_value: string; }; export type ProjectApiKeyDeleteResponse = { - object: 'organization.project.api_key.deleted'; - id: string; - deleted: boolean; + deleted: boolean; + id: string; + object: 'organization.project.api_key.deleted'; }; export type ProjectApiKeyListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: 'list'; }; 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; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: 'list'; }; /** * 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 maximum batch input tokens per day. Only present for relevant models. + */ + batch_1_day_max_input_tokens?: number; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The maximum audio megabytes per minute. Only present for relevant models. + */ + max_audio_megabytes_per_1_minute?: number; + /** + * The maximum images per minute. Only present for relevant models. + */ + max_images_per_1_minute?: number; + /** + * The maximum requests per day. Only present for relevant models. + */ + max_requests_per_1_day?: number; + /** + * The maximum requests per minute. + */ + max_requests_per_1_minute: number; + /** + * The maximum tokens per minute. + */ + max_tokens_per_1_minute: number; + /** + * The model this rate limit applies to. + */ + model: string; + /** + * The object type, which is always `project.rate_limit` + */ + object: 'project.rate_limit'; }; export type ProjectRateLimitListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: 'list'; }; 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 batch input tokens per day. Only relevant for certain models. + */ + batch_1_day_max_input_tokens?: number; + /** + * The maximum audio megabytes per minute. Only relevant for certain models. + */ + max_audio_megabytes_per_1_minute?: number; + /** + * The maximum images per minute. Only relevant for certain models. + */ + max_images_per_1_minute?: number; + /** + * The maximum requests per day. Only relevant for certain models. + */ + max_requests_per_1_day?: number; + /** + * The maximum requests per minute. + */ + max_requests_per_1_minute?: number; + /** + * The maximum tokens per minute. + */ + max_tokens_per_1_minute?: 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 Unix timestamp (in seconds) of when the service account was created + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the service account + */ + name: string; + /** + * The object type, which is always `organization.project.service_account` + */ + object: 'organization.project.service_account'; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; }; 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; + created_at: number; + id: string; + name: string; + /** + * The object type, which is always `organization.project.service_account.api_key` + */ + object: 'organization.project.service_account.api_key'; + value: 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; + api_key: ProjectServiceAccountApiKey; + created_at: number; + id: string; + name: string; + object: 'organization.project.service_account'; + /** + * Service accounts can only have one role of type `member` + */ + role: 'member'; }; export type ProjectServiceAccountDeleteResponse = { - object: 'organization.project.service_account.deleted'; - id: string; - deleted: boolean; + deleted: boolean; + id: string; + object: 'organization.project.service_account.deleted'; }; export type ProjectServiceAccountListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: 'list'; }; 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 Unix timestamp (in seconds) of when the project was added. + */ + added_at: number; + /** + * The email address of the user + */ + email: string; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the user + */ + name: string; + /** + * The object type, which is always `organization.project.user` + */ + object: 'organization.project.user'; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; }; export type ProjectUserCreateRequest = { - /** - * The ID of the user. - */ - user_id: string; - /** - * `owner` or `member` - */ - role: 'owner' | 'member'; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; + /** + * The ID of the user. + */ + user_id: string; }; export type ProjectUserDeleteResponse = { - object: 'organization.project.user.deleted'; - id: string; - deleted: boolean; + deleted: boolean; + id: string; + object: 'organization.project.user.deleted'; }; export type ProjectUserListResponse = { - object: string; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: string; }; 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; + variables?: ResponsePromptVariables; + /** + * Optional version of the prompt template. + */ + version?: string; }; /** * 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; + item: RealtimeConversationItem; + /** + * 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; + /** + * The event type, must be `conversation.item.create`. + */ + type: 'conversation.item.create'; }; /** @@ -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 ID of the item to delete. + */ + item_id: string; + /** + * The event type, must be `conversation.item.delete`. + */ + type: 'conversation.item.delete'; }; /** @@ -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 ID of the item to retrieve. + */ + item_id: string; + /** + * The event type, must be `conversation.item.retrieve`. + */ + type: 'conversation.item.retrieve'; }; /** @@ -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; + /** + * 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; + /** + * The index of the content part to truncate. Set this to 0. + */ + content_index: number; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + /** + * The ID of the assistant message item to truncate. Only assistant message + * items can be truncated. + * + */ + item_id: string; + /** + * The event type, must be `conversation.item.truncate`. + */ + type: 'conversation.item.truncate'; }; /** @@ -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; + /** + * 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'; }; /** @@ -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; + /** + * A specific response ID to cancel - if not provided, will cancel an + * in-progress response in the default conversation. + * + */ + response_id?: string; + /** + * The event type, must be `response.cancel`. + */ + type: 'response.cancel'; }; /** @@ -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; + response?: RealtimeResponseCreateParams; + /** + * The event type, must be `response.create`. + */ + type: 'response.create'; }; /** @@ -9468,17 +9815,17 @@ export type RealtimeClientEventResponseCreate = { * 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; + */ +export type RealtimeClientEventSessionUpdate = { + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + session: RealtimeSessionCreateRequest; + /** + * The event type, must be `session.update`. + */ + type: 'session.update'; }; /** @@ -9486,547 +9833,581 @@ export type RealtimeClientEventSessionUpdate = { * */ 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; + /** + * Optional client-generated ID used to identify this event. + */ + event_id?: string; + session: RealtimeTranscriptionSessionCreateRequest; + /** + * The event type, must be `transcription_session.update`. + */ + type: 'transcription_session.update'; }; /** * 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 arguments of the function call (for `function_call` items). + * + */ + arguments?: 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 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 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 name of the function being called (for `function_call` items). + * + */ + name?: string; + /** + * Identifier for the API object being returned - always `realtime.item`. + * + */ + object?: 'realtime.item'; + /** + * The output of the function call (for `function_call_output` items). + * + */ + output?: string; + /** + * The role of the message sender (`user`, `assistant`, `system`), only + * applicable for `message` items. + * + */ + role?: 'user' | 'assistant' | 'system'; + /** + * 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 type of the item (`message`, `function_call`, `function_call_output`). + * + */ + type?: 'message' | 'function_call' | 'function_call_output'; }; /** * The item to add to the conversation. */ export type RealtimeConversationItemWithReference = { + /** + * The arguments of the function call (for `function_call` items). + * + */ + arguments?: 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 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<{ /** - * 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. + * Base64-encoded audio bytes, used for `input_audio` content type. * */ - 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; - }>; + audio?: 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. + * 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. * */ - call_id?: string; + id?: string; /** - * The name of the function being called (for `function_call` items). + * The text content, used for `input_text` and `text` content types. * */ - name?: string; + text?: string; /** - * The arguments of the function call (for `function_call` items). + * The transcript of the audio, used for `input_audio` content type. * */ - arguments?: string; + transcript?: string; /** - * The output of the function call (for `function_call_output` items). - * - */ - output?: string; + * 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 name of the function being called (for `function_call` items). + * + */ + name?: string; + /** + * Identifier for the API object being returned - always `realtime.item`. + * + */ + object?: 'realtime.item'; + /** + * The output of the function call (for `function_call_output` items). + * + */ + output?: string; + /** + * The role of the message sender (`user`, `assistant`, `system`), only + * applicable for `message` items. + * + */ + role?: 'user' | 'assistant' | 'system'; + /** + * 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 type of the item (`message`, `function_call`, `function_call_output`, `item_reference`). + * + */ + type?: 'message' | 'function_call' | 'function_call_output' | 'item_reference'; }; /** * 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`). + /** + * 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 unique ID of the response. + */ + id?: string; + /** + * 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'; + metadata?: Metadata; + /** + * 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 object type, must be `realtime.response`. + */ + object?: 'realtime.response'; + /** + * The list of output items generated by the response. + */ + output?: Array; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * 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?: { + /** + * A description of the error that caused the response to fail, + * populated when the `status` is `failed`. * */ - 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. - * + error?: { + /** + * Error code, if any. + */ + code?: string; + /** + * The type of error. + */ + type?: string; + }; + /** + * 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'; + /** + * The type of error that caused the response to fail, corresponding + * with the `status` field (`completed`, `cancelled`, `incomplete`, + * `failed`). + * + */ + type?: 'completed' | 'cancelled' | 'incomplete' | 'failed'; + }; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * + */ + temperature?: number; + /** + * 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?: { + /** + * Details about the input tokens used in the Response. */ - 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; - }; + input_token_details?: { + /** + * The number of audio tokens used in the Response. + */ + audio_tokens?: number; + /** + * The number of cached tokens used in the Response. + */ + cached_tokens?: number; + /** + * The number of text tokens used in the Response. + */ + text_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. + * The number of input tokens used in the Response, including text and + * audio tokens. * */ - modalities?: Array<'text' | 'audio'>; + input_tokens?: number; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * + * Details about the output tokens used in the Response. */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + output_token_details?: { + /** + * The number of audio tokens used in the Response. + */ + audio_tokens?: number; + /** + * The number of text tokens used in the Response. + */ + text_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. + * The total number of tokens in the Response including input and output + * text and audio tokens. * */ - max_output_tokens?: number | 'inf'; + total_tokens?: number; + }; + /** + * The voice the model used to respond. + * Current voice options are `alloy`, `ash`, `ballad`, `coral`, `echo`, `sage`, + * `shimmer`, and `verse`. + * + */ + voice?: VoiceIdsShared; }; /** * 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"]. - * - */ - 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"}}`. + /** + * 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'; + /** + * 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; + /** + * 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; + /** + * 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'; + metadata?: Metadata; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + 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; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`. + * + */ + tool_choice?: string; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ + /** + * 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). * */ - tool_choice?: string; - /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - * - */ - 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`. - * + * 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. - * + * Parameters of the function in JSON Schema. */ - conversation?: string | 'auto' | 'none'; - metadata?: Metadata; + parameters?: { + [key: string]: unknown; + }; /** - * 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. - * + * The type of the tool, i.e. `function`. */ - input?: Array; + type?: 'function'; + }>; + /** + * 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; }; /** * 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 conversation resource. + */ + conversation: { /** - * The unique ID of the server event. + * The unique ID of the conversation. */ - event_id: string; - /** - * The event type, must be `conversation.created`. - */ - 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'; + }; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.created`. + */ + type: 'conversation.created'; }; /** @@ -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; + item: RealtimeConversationItem; + /** + * 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; + /** + * The event type, must be `conversation.item.created`. + */ + type: 'conversation.item.created'; }; /** @@ -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 ID of the item that was deleted. + */ + item_id: string; + /** + * The event type, must be `conversation.item.deleted`. + */ + type: 'conversation.item.deleted'; }; /** @@ -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 index of the content part containing the audio. + */ + content_index: number; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The ID of the user message item containing the audio. + */ + item_id: string; + /** + * The log probabilities of the transcription. + */ + logprobs?: Array; + /** + * The transcribed text. + */ + transcript: string; + /** + * The event type, must be + * `conversation.item.input_audio_transcription.completed`. + * + */ + type: 'conversation.item.input_audio_transcription.completed'; + /** + * 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 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 ID of the item. + */ + item_id: string; + /** + * The log probabilities of the transcription. + */ + logprobs?: Array; + /** + * The event type, must be `conversation.item.input_audio_transcription.delta`. + */ + type: 'conversation.item.input_audio_transcription.delta'; }; /** @@ -10165,45 +10546,45 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionDelta = { * */ export type RealtimeServerEventConversationItemInputAudioTranscriptionFailed = { + /** + * The index of the content part containing the audio. + */ + content_index: number; + /** + * Details of the transcription error. + */ + error: { /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be - * `conversation.item.input_audio_transcription.failed`. - * + * Error code, if any. */ - type: 'conversation.item.input_audio_transcription.failed'; + code?: string; /** - * The ID of the user message item. + * A human-readable error message. */ - item_id: string; + message?: string; /** - * The index of the content part containing the audio. + * Parameter related to the error, if any. */ - content_index: number; + param?: string; /** - * Details of the transcription error. + * The type of error. */ - 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; - }; + type?: string; + }; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The ID of the user message item. + */ + item_id: string; + /** + * The event type, must be + * `conversation.item.input_audio_transcription.failed`. + * + */ + type: 'conversation.item.input_audio_transcription.failed'; }; /** @@ -10211,15 +10592,15 @@ 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; + item: RealtimeConversationItem; + /** + * The event type, must be `conversation.item.retrieved`. + */ + type: 'conversation.item.retrieved'; }; /** @@ -10232,27 +10613,27 @@ export type RealtimeServerEventConversationItemRetrieved = { * */ 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; + /** + * The duration up to which the audio was truncated, in milliseconds. + * + */ + audio_end_ms: number; + /** + * The index of the content part that was truncated. + */ + content_index: number; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The ID of the assistant message item that was truncated. + */ + item_id: string; + /** + * The event type, must be `conversation.item.truncated`. + */ + type: 'conversation.item.truncated'; }; /** @@ -10262,41 +10643,41 @@ export type RealtimeServerEventConversationItemTruncated = { * */ export type RealtimeServerEventError = { + /** + * Details of the error. + */ + error: { /** - * The unique ID of the server event. + * Error code, if any. */ - event_id: string; + code?: string; /** - * The event type, must be `error`. + * The event_id of the client event that caused the error, if applicable. + * */ - type: 'error'; + event_id?: string; /** - * Details of the error. + * A human-readable error message. */ - 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; - }; + message: string; + /** + * Parameter related to the error, if any. + */ + param?: string; + /** + * The type of error (e.g., "invalid_request_error", "server_error"). + * + */ + type: string; + }; + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `error`. + */ + type: 'error'; }; /** @@ -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 ID of the user message item that will be created. + */ + item_id: string; + /** + * 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 event type, must be `input_audio_buffer.committed`. + */ + type: 'input_audio_buffer.committed'; }; /** @@ -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; + /** + * 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 unique ID of the server event. + */ + event_id: string; + /** + * The ID of the user message item that will be created when speech stops. + * + */ + item_id: string; + /** + * The event type, must be `input_audio_buffer.speech_started`. + */ + type: 'input_audio_buffer.speech_started'; }; /** @@ -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; + /** + * 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 unique ID of the server event. + */ + event_id: string; + /** + * The ID of the user message item that will be created. + */ + item_id: string; + /** + * The event type, must be `input_audio_buffer.speech_stopped`. + */ + type: 'input_audio_buffer.speech_stopped'; }; /** @@ -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 unique ID of the response that produced the audio. + */ + response_id: string; + /** + * The event type, must be `output_audio_buffer.cleared`. + */ + type: 'output_audio_buffer.cleared'; }; /** @@ -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 unique ID of the response that produced the audio. + */ + response_id: string; + /** + * The event type, must be `output_audio_buffer.started`. + */ + type: 'output_audio_buffer.started'; }; /** @@ -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 unique ID of the response that produced the audio. + */ + response_id: string; + /** + * The event type, must be `output_audio_buffer.stopped`. + */ + type: 'output_audio_buffer.stopped'; }; /** @@ -10483,70 +10864,70 @@ export type RealtimeServerEventOutputAudioBufferStopped = { * */ export type RealtimeServerEventRateLimitsUpdated = { + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * List of rate limit information. + */ + rate_limits: Array<{ /** - * The unique ID of the server event. + * The maximum allowed value for the rate limit. */ - event_id: string; + limit?: number; /** - * The event type, must be `rate_limits.updated`. + * The name of the rate limit (`requests`, `tokens`). + * */ - type: 'rate_limits.updated'; + name?: 'requests' | 'tokens'; /** - * 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; + }>; + /** + * The event type, must be `rate_limits.updated`. + */ + type: 'rate_limits.updated'; }; /** * 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 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the response. + */ + response_id: string; + /** + * The event type, must be `response.audio.delta`. + */ + type: 'response.audio.delta'; }; /** @@ -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 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the response. + */ + response_id: string; + /** + * The event type, must be `response.audio.done`. + */ + type: 'response.audio.done'; }; /** @@ -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 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the response. + */ + response_id: string; + /** + * The event type, must be `response.audio_transcript.delta`. + */ + type: 'response.audio_transcript.delta'; }; /** @@ -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 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the response. + */ + response_id: string; + /** + * The final transcript of the audio. + */ + transcript: string; + /** + * The event type, must be `response.audio_transcript.done`. + */ + type: 'response.audio_transcript.done'; }; /** @@ -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`. + /** + * 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 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 content part that was added. + */ + part: { + /** + * Base64-encoded audio data (if type is "audio"). */ - 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; + audio?: string; /** - * The index of the output item in the response. + * The text content (if type is "text"). */ - output_index: number; + text?: string; /** - * The index of the content part in the item's content array. + * The transcript of the audio (if type is "audio"). */ - content_index: number; + transcript?: string; /** - * The content part that was added. + * The content type ("text", "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; - }; + type?: 'text' | 'audio'; + }; + /** + * The ID of the response. + */ + response_id: string; + /** + * The event type, must be `response.content_part.added`. + */ + type: 'response.content_part.added'; }; /** @@ -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. + /** + * 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The content part that is done. + */ + part: { + /** + * Base64-encoded audio data (if type is "audio"). */ - item_id: string; + audio?: string; /** - * The index of the output item in the response. + * The text content (if type is "text"). */ - output_index: number; + text?: string; /** - * The index of the content part in the item's content array. + * The transcript of the audio (if type is "audio"). */ - content_index: number; + transcript?: string; /** - * The content part that is done. + * The content type ("text", "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; - }; + type?: 'text' | 'audio'; + }; + /** + * The ID of the response. + */ + response_id: string; + /** + * The event type, must be `response.content_part.done`. + */ + type: 'response.content_part.done'; }; /** @@ -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; + response: RealtimeResponse; + /** + * The event type, must be `response.created`. + */ + type: 'response.created'; }; /** @@ -10783,111 +11164,111 @@ 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; + response: RealtimeResponse; + /** + * The event type, must be `response.done`. + */ + type: 'response.done'; }; /** * Returned when the model-generated function call arguments are updated. * - */ -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; -}; - -/** - * Returned when the model-generated function call arguments are done streaming. - * Also emitted when a Response is interrupted, incomplete, or cancelled. - * - */ -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; + */ +export type RealtimeServerEventResponseFunctionCallArgumentsDelta = { + /** + * 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 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 response. + */ + response_id: string; + /** + * The event type, must be `response.function_call_arguments.delta`. + * + */ + type: 'response.function_call_arguments.delta'; +}; + +/** + * Returned when the model-generated function call arguments are done streaming. + * Also emitted when a Response is interrupted, incomplete, or cancelled. + * + */ +export type RealtimeServerEventResponseFunctionCallArgumentsDone = { + /** + * The final arguments as a JSON string. + */ + arguments: string; + /** + * The ID of the function call. + */ + call_id: string; + /** + * The unique ID of the server event. + */ + event_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 response. + */ + response_id: string; + /** + * The event type, must be `response.function_call_arguments.done`. + * + */ + type: 'response.function_call_arguments.done'; }; /** * 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; + item: RealtimeConversationItem; + /** + * The index of the output item in the Response. + */ + output_index: number; + /** + * The ID of the Response to which the item belongs. + */ + response_id: string; + /** + * The event type, must be `response.output_item.added`. + */ + type: 'response.output_item.added'; }; /** @@ -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; + item: RealtimeConversationItem; + /** + * The index of the output item in the Response. + */ + output_index: number; + /** + * The ID of the Response to which the item belongs. + */ + response_id: string; + /** + * The event type, must be `response.output_item.done`. + */ + type: 'response.output_item.done'; }; /** * 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 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the response. + */ + response_id: string; + /** + * The event type, must be `response.text.delta`. + */ + type: 'response.text.delta'; }; /** @@ -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 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 ID of the item. + */ + item_id: string; + /** + * The index of the output item in the response. + */ + output_index: number; + /** + * The ID of the response. + */ + response_id: string; + /** + * The final text content. + */ + text: string; + /** + * The event type, must be `response.text.done`. + */ + type: 'response.text.done'; }; /** @@ -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; + session: RealtimeSession; + /** + * The event type, must be `session.created`. + */ + type: 'session.created'; }; /** @@ -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; + session: RealtimeSession; + /** + * The event type, must be `session.updated`. + */ + type: 'session.updated'; }; /** @@ -11026,404 +11407,424 @@ 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; + session: RealtimeTranscriptionSessionCreateResponse; + /** + * The event type, must be `transcription_session.updated`. + */ + type: 'transcription_session.updated'; }; /** * Realtime session object configuration. */ export type RealtimeSession = { - /** - * Unique identifier for the session that looks like `sess_1234567890abcdef`. + /** + * Unique identifier for the session that looks like `sess_1234567890abcdef`. + * + */ + id?: 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. + * + */ + input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + /** + * 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'; + }; + /** + * 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 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. * */ - 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'; + language?: string; /** - * 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. + * 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`. + * 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". * */ - 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. + prompt?: string; + }; + /** + * 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; + /** + * 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'; + /** + * 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 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'; + /** + * 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; + /** + * 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; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. + * + */ + tool_choice?: string; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ + /** + * 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). * */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + description?: string; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, output audio is sampled at a rate of 24kHz. - * + * The name of the function. */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + name?: 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 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. - * + * Parameters of the function in JSON Schema. */ - 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; + parameters?: { + [key: string]: unknown; }; /** - * 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. - * + * The type of the tool, i.e. `function`. */ - 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; + type?: 'function'; + }>; + /** + * 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' + | { /** - * 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. + * The group id to attach to this trace to enable filtering and + * grouping in the traces dashboard. * */ - silence_duration_ms?: number; + group_id?: string; /** - * Whether or not to automatically generate a response when a VAD stop event occurs. + * The arbitrary metadata to attach to this trace to enable + * filtering in the traces dashboard. * */ - create_response?: boolean; + metadata?: { + [key: string]: unknown; + }; /** - * 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. + * The name of the workflow to attach to this trace. This is used to + * name the trace in the traces dashboard. * */ - interrupt_response?: boolean; - }; + workflow_name?: 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?: { /** - * 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. + * Whether or not to automatically generate a response when a VAD stop event occurs. * */ - 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'; - }; + create_response?: boolean; /** - * 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 `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`. * */ - speed?: number; + eagerness?: 'low' | 'medium' | 'high' | 'auto'; /** - * 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. + * 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. * */ - tracing?: 'auto' | { - /** - * The name of the workflow to attach to this trace. This is used to - * name the trace in the traces dashboard. - * - */ - 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; - }; - }; + interrupt_response?: boolean; /** - * Tools (functions) available to the model. + * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. + * */ - 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; - }; - }>; + prefix_padding_ms?: number; /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. + * 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. * */ - tool_choice?: string; + silence_duration_ms?: number; /** - * 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. + * 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. * */ - temperature?: number; + threshold?: 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`. + * Type of turn detection. * */ - max_response_output_tokens?: number | 'inf'; + type?: 'server_vad' | 'semantic_vad'; + }; + /** + * 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; }; /** * Realtime session object configuration. */ export type RealtimeSessionCreateRequest = { + /** + * Configuration options for the generated client secret. + * + */ + client_secret?: { /** - * 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. + * Configuration for the ephemeral token expiration. * */ - 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`. + 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; + }; + }; + /** + * 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 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'; + }; + /** + * 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 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. + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + model?: string; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, output audio is sampled at a rate of 24kHz. + * 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". * */ - 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. + prompt?: string; + }; + /** + * 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; + /** + * 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'; + /** + * 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 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'; + /** + * 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; + /** + * 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; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. + * + */ + tool_choice?: string; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ + /** + * 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). * */ - 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; - }; + description?: 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. - * + * The name of the function. */ - 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; - }; + name?: string; /** - * 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. - * + * Parameters of the function in JSON Schema. */ - 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'; + parameters?: { + [key: string]: unknown; }; /** - * 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. - * + * The type of the tool, i.e. `function`. */ - tracing?: 'auto' | { - /** - * The name of the workflow to attach to this trace. This is used to - * name the trace in the traces dashboard. - * - */ - workflow_name?: string; + type?: 'function'; + }>; + /** + * 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 group id to attach to this trace to enable filtering and * grouping in the traces dashboard. @@ -11436,76 +11837,72 @@ export type RealtimeSessionCreateRequest = { * */ metadata?: { - [key: string]: unknown; + [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). + * The name of the workflow to attach to this trace. This is used to + * name the trace in the traces dashboard. * */ - description?: string; - /** - * Parameters of the function in JSON Schema. - */ - parameters?: { - [key: string]: unknown; - }; - }>; + workflow_name?: 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?: { + /** + * Whether or not to automatically generate a response when a VAD stop event occurs. + * + */ + create_response?: boolean; + /** + * 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'; + /** + * 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; /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. + * Used only for `server_vad` mode. 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]. For audio models a temperature of 0.8 is highly recommended for best performance. + * 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. * */ - temperature?: number; + silence_duration_ms?: 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`. + * 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. * */ - max_response_output_tokens?: number | 'inf'; + threshold?: number; /** - * Configuration options for the generated client secret. + * Type of turn detection. * */ - 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; - }; - }; + type?: 'server_vad' | 'semantic_vad'; + }; + /** + * 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; }; /** @@ -11514,103 +11911,136 @@ export type RealtimeSessionCreateRequest = { * */ export type RealtimeSessionCreateResponse = { + /** + * Ephemeral key returned by the API. + */ + client_secret: { /** - * 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. - * - */ - value: string; - /** - * 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"]. + * Timestamp for when the token expires. Currently, all tokens expire + * after one minute. * */ - modalities?: unknown; + expires_at: number; /** - * 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. + * 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. * */ - 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`. + value: string; + }; + /** + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + input_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. * */ - voice?: VoiceIdsShared; - /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + model?: string; + }; + /** + * 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; + /** + * 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'; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * + */ + output_audio_format?: 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; + /** + * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * + */ + temperature?: number; + /** + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. + * + */ + tool_choice?: string; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ + /** + * 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). * */ - input_audio_format?: string; + description?: string; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * + * The name of the function. */ - output_audio_format?: string; + name?: 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. */ - input_audio_transcription?: { - /** - * The model to use for transcription. - * - */ - model?: string; + parameters?: { + [key: string]: unknown; }; /** - * 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. - * + * The type of the tool, i.e. `function`. */ - tracing?: 'auto' | { - /** - * The name of the workflow to attach to this trace. This is used to - * name the trace in the traces dashboard. - * - */ - workflow_name?: string; + type?: 'function'; + }>; + /** + * 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 group id to attach to this trace to enable filtering and * grouping in the traces dashboard. @@ -11623,222 +12053,191 @@ 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?: { - /** - * 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. + * The name of the workflow to attach to this trace. This is used to + * name the trace in the traces dashboard. * */ - silence_duration_ms?: number; - }; + workflow_name?: 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?: { /** - * Tools (functions) available to the model. + * Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. + * */ - 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; - }; - }>; + prefix_padding_ms?: number; /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. + * 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. * */ - tool_choice?: string; + silence_duration_ms?: number; /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. + * 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. * */ - temperature?: number; + threshold?: 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`. + * Type of turn detection, only `server_vad` is currently supported. * */ - max_response_output_tokens?: number | 'inf'; + type?: 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; }; /** * Realtime transcription session object configuration. */ export type RealtimeTranscriptionSessionCreateRequest = { + /** + * 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; + }; + }; + /** + * The set of items to include in the transcription. Current available items are: + * - `item.input_audio_transcription.logprobs` + * + */ + include?: Array; + /** + * 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 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'; + }; + /** + * 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 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"]. + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - modalities?: unknown; + model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1'; /** - * 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; + }; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: unknown; + /** + * 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?: { /** - * Configuration for input audio transcription. The client can optionally set the language and prompt for transcription, these offer additional guidance to the transcription service. + * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions. * */ - 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; - }; + create_response?: boolean; /** - * 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 `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`. * */ - 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; - }; + eagerness?: 'low' | 'medium' | 'high' | 'auto'; /** - * 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. + * 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. * */ - 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'; - }; + interrupt_response?: boolean; /** - * The set of items to include in the transcription. Current available items are: - * - `item.input_audio_transcription.logprobs` + * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - include?: Array; + prefix_padding_ms?: number; /** - * Configuration options for the generated client secret. + * 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. * */ - 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; - }; - }; + silence_duration_ms?: number; + /** + * 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; + /** + * Type of turn detection. + * + */ + type?: 'server_vad' | 'semantic_vad'; + }; }; /** @@ -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. + * Timestamp for when the token expires. Currently, all tokens expire + * after one minute. * */ - 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; - }; + expires_at: number; /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. + * 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. * */ - modalities?: unknown; + value: string; + }; + /** + * 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 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 format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * The model to use for transcription. Can be `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, or `whisper-1`. * */ - input_audio_format?: string; + model?: 'gpt-4o-transcribe' | 'gpt-4o-mini-transcribe' | 'whisper-1'; /** - * Configuration of the transcription model. + * 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_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; - }; + prompt?: string; + }; + /** + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. + * + */ + modalities?: 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. + * Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - 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; - }; + 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; + /** + * 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; + /** + * Type of turn detection, only `server_vad` is currently supported. + * + */ + type?: string; + }; }; /** @@ -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; + /** + * **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'; + /** + * 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'; }; /** @@ -11981,10 +12380,10 @@ export type Reasoning = { * */ export const ReasoningEffort = { - MINIMAL: 'minimal', - LOW: 'low', - MEDIUM: 'medium', - HIGH: 'high' + HIGH: 'high', + LOW: 'low', + MEDIUM: 'medium', + MINIMAL: 'minimal', } 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,98 +12406,102 @@ export type ReasoningEffort = typeof ReasoningEffort[keyof typeof ReasoningEffor * */ export type ReasoningItem = { + /** + * Reasoning text content. + * + */ + content?: Array<{ /** - * 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. + * Reasoning text output from the model. * */ - 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. + * The type of the object. Always `reasoning_text`. + * + */ + type: 'reasoning_text'; + }>; + /** + * The encrypted content of the reasoning item - populated when a response is + * generated with `reasoning.encrypted_content` in the `include` parameter. + * + */ + encrypted_content?: string; + /** + * The unique identifier of the reasoning content. + * + */ + id: 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'; + /** + * Reasoning summary content. + * + */ + summary: Array<{ + /** + * A summary of the reasoning output from the model so far. * */ - content?: Array<{ - /** - * The type of the object. Always `reasoning_text`. - * - */ - type: 'reasoning_text'; - /** - * Reasoning text output from the model. - * - */ - text: string; - }>; + text: string; /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. + * The type of the object. Always `summary_text`. * */ - status?: 'in_progress' | 'completed' | 'incomplete'; + type: 'summary_text'; + }>; + /** + * The type of the object. Always `reasoning`. + * + */ + type: 'reasoning'; }; /** * The response object */ -export type Response = ModelResponseProperties & ResponseProperties & { - /** - * Unique identifier for this Response. - * - */ - id: string; - /** - * The object type of this resource - always set to `response`. - * - */ - object: 'response'; - /** - * The status of the response generation. One of `completed`, `failed`, - * `in_progress`, `cancelled`, `queued`, or `incomplete`. - * - */ - status?: 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete'; +export type Response = ModelResponseProperties & + ResponseProperties & { /** * Unix timestamp (in seconds) of when this Response was created. * */ created_at: number; error: ResponseError; + /** + * Unique identifier for this Response. + * + */ + id: string; /** * Details about why the response is incomplete. * */ 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'; }; + /** + * 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 | Array; + /** + * The object type of this resource - always set to `response`. + * + */ + object: 'response'; /** * An array of content items generated by the model. * @@ -12111,15 +12514,6 @@ export type Response = ModelResponseProperties & ResponseProperties & { * */ output: Array; - /** - * 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 | Array; /** * SDK-only convenience property that contains the aggregated text output * from all `output_text` items in the `output` array, if any are present. @@ -12127,292 +12521,298 @@ export type Response = ModelResponseProperties & ResponseProperties & { * */ output_text?: string; - usage?: ResponseUsage; /** * Whether to allow the model to run tool calls in parallel. * */ parallel_tool_calls: boolean; -}; + /** + * The status of the response generation. One of `completed`, `failed`, + * `in_progress`, `cancelled`, `queued`, or `incomplete`. + * + */ + status?: 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete'; + usage?: ResponseUsage; + }; /** * 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; + /** + * A chunk of Base64 encoded response audio bytes. + * + */ + delta: string; + /** + * A sequence number for this chunk of the stream response. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.audio.delta`. + * + */ + type: 'response.audio.delta'; }; /** * 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 sequence number of the delta. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.audio.done`. + * + */ + type: 'response.audio.done'; }; /** * 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; + /** + * The partial transcript of the audio response. + * + */ + delta: string; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The type of the event. Always `response.audio.transcript.delta`. + * + */ + type: 'response.audio.transcript.delta'; }; /** * 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 sequence number of this event. + */ + sequence_number: number; + /** + * The type of the event. Always `response.audio.transcript.done`. + * + */ + type: 'response.audio.transcript.done'; }; /** * 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 partial code snippet being streamed by the code interpreter. + */ + delta: string; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The index of the output item in the response for which the code is being streamed. + */ + output_index: number; + /** + * 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'; }; /** * 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 final code snippet output by the code interpreter. + */ + code: string; + /** + * The unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The index of the output item in the response for which the code is finalized. + */ + output_index: number; + /** + * 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'; }; /** * 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 unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The index of the output item in the response for which the code interpreter call is completed. + */ + output_index: number; + /** + * 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'; }; /** * 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 unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The index of the output item in the response for which the code interpreter call is in progress. + */ + output_index: number; + /** + * 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'; }; /** * 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 unique identifier of the code interpreter tool call item. + */ + item_id: string; + /** + * The index of the output item in the response for which the code interpreter is interpreting code. + */ + output_index: number; + /** + * 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'; }; /** * 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; + /** + * 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'; }; /** * 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 index of the content part that was added. + * + */ + content_index: number; + /** + * 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 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'; }; /** * 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 index of the content part that is done. + * + */ + content_index: number; + /** + * 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 content part that is done. + * + */ + part: OutputContent; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The type of the event. Always `response.content_part.done`. + * + */ + type: 'response.content_part.done'; }; /** @@ -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 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'; }; /** @@ -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 incremental input data (delta) for the custom tool call. + */ + delta: string; + /** + * Unique identifier for the API item associated with this event. + */ + item_id: string; + /** + * The index of the output this delta applies to. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The event type identifier. + */ + type: 'response.custom_tool_call_input.delta'; }; /** @@ -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 complete input data for the custom tool call. + */ + input: string; + /** + * Unique identifier for the API item associated with this event. + */ + item_id: string; + /** + * The index of the output this event applies to. + */ + output_index: number; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The event type identifier. + */ + type: 'response.custom_tool_call_input.done'; }; /** @@ -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' + EMPTY_IMAGE_FILE: 'empty_image_file', + FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image', + IMAGE_CONTENT_POLICY_VIOLATION: 'image_content_policy_violation', + IMAGE_FILE_NOT_FOUND: 'image_file_not_found', + IMAGE_FILE_TOO_LARGE: 'image_file_too_large', + IMAGE_PARSE_ERROR: 'image_parse_error', + IMAGE_TOO_LARGE: 'image_too_large', + IMAGE_TOO_SMALL: 'image_too_small', + INVALID_BASE64_IMAGE: 'invalid_base64_image', + INVALID_IMAGE: 'invalid_image', + INVALID_IMAGE_FORMAT: 'invalid_image_format', + INVALID_IMAGE_MODE: 'invalid_image_mode', + INVALID_IMAGE_URL: 'invalid_image_url', + INVALID_PROMPT: 'invalid_prompt', + RATE_LIMIT_EXCEEDED: 'rate_limit_exceeded', + SERVER_ERROR: 'server_error', + UNSUPPORTED_IMAGE_MEDIA_TYPE: 'unsupported_image_media_type', + VECTOR_STORE_TIMEOUT: 'vector_store_timeout', } 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 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'; }; /** @@ -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 response that failed. + * + */ + response: Response; + /** + * The sequence number of this event. + */ + sequence_number: number; + /** + * The type of the event. Always `response.failed`. + * + */ + type: 'response.failed'; }; /** * 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 ID of the output item that the file search call is initiated. + * + */ + item_id: string; + /** + * The index of the output item that the file search call is initiated. + * + */ + output_index: number; + /** + * 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'; }; -/** - * 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; -}; - -/** - * 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; +/** + * Emitted when a file search call is initiated. + */ +export type ResponseFileSearchCallInProgressEvent = { + /** + * The ID of the output item that the file search call is initiated. + * + */ + item_id: string; + /** + * The index of the output item that the file search call is initiated. + * + */ + output_index: number; + /** + * 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'; +}; + +/** + * Emitted when a file search is currently searching. + */ +export type ResponseFileSearchCallSearchingEvent = { + /** + * The ID of the output item that the file search call is initiated. + * + */ + item_id: string; + /** + * The index of the output item that the file search call is searching. + * + */ + output_index: number; + /** + * 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'; }; /** @@ -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 = { + /** + * 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; + }; + /** + * The type of response format being defined. Always `json_schema`. + */ + type: 'json_schema'; }; /** @@ -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 custom grammar for the model to follow. + */ + grammar: string; + /** + * The type of response format being defined. Always `grammar`. + */ + type: 'grammar'; }; /** @@ -12774,63 +13174,63 @@ 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 function-call arguments delta that is added. + * + */ + delta: string; + /** + * 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 type of the event. Always `response.function_call_arguments.delta`. + * + */ + type: 'response.function_call_arguments.delta'; }; /** * 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; + /** + * The function-call arguments. + */ + arguments: string; + /** + * 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; + type: 'response.function_call_arguments.done'; }; /** @@ -12840,22 +13240,22 @@ export type ResponseFunctionCallArgumentsDoneEvent = { * */ 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; + /** + * The unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * 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 type of the event. Always 'response.image_generation_call.completed'. + */ + type: 'response.image_generation_call.completed'; }; /** @@ -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 unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * 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'; }; /** @@ -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 unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * 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'; }; /** @@ -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 unique identifier of the image generation item being processed. + */ + item_id: string; + /** + * The index of the output item in the response's output array. + */ + output_index: number; + /** + * Base64-encoded partial image data, suitable for rendering as an image. + */ + partial_image_b64: string; + /** + * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + */ + partial_image_index: number; + /** + * The sequence number of the image generation item being processed. + */ + sequence_number: number; + /** + * The type of the event. Always 'response.image_generation_call.partial_image'. + */ + type: 'response.image_generation_call.partial_image'; }; /** * 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 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'; }; /** @@ -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 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'; }; /** * 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; + /** + * A list of items used to generate this response. + */ + data: Array; + /** + * The ID of the first item in the list. + */ + first_id: string; + /** + * Whether there are more items available. + */ + has_more: boolean; + /** + * The ID of the last item in the list. + */ + last_id: string; + /** + * The type of object returned, must be `list`. + */ + object: 'list'; }; /** @@ -13015,29 +13415,29 @@ export type ResponseItemList = { * */ export type ResponseLogProb = { - /** - * A possible text token. - */ - token: string; + /** + * The log probability of this token. + * + */ + logprob: number; + /** + * A possible text token. + */ + token: string; + /** + * The log probability of the top 20 most likely tokens. + * + */ + top_logprobs?: Array<{ /** * The log probability of this token. - * */ - logprob: number; + logprob?: number; /** - * The log probability of the top 20 most likely tokens. - * + * A possible text token. */ - top_logprobs?: Array<{ - /** - * A possible text token. - */ - token?: string; - /** - * The log probability of this token. - */ - logprob?: number; - }>; + token?: string; + }>; }; /** @@ -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; + /** + * A JSON string containing the partial update to the arguments for the MCP tool call. + * + */ + delta: string; + /** + * The unique identifier of the MCP tool call item being processed. + */ + item_id: string; + /** + * 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 type of the event. Always 'response.mcp_call_arguments.delta'. + */ + type: 'response.mcp_call_arguments.delta'; }; /** @@ -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; + /** + * A JSON string containing the finalized arguments for the MCP tool call. + * + */ + arguments: string; + /** + * The unique identifier of the MCP tool call item being processed. + */ + item_id: string; + /** + * 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 type of the event. Always 'response.mcp_call_arguments.done'. + */ + type: 'response.mcp_call_arguments.done'; }; /** @@ -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 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'; }; /** @@ -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 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'; }; /** @@ -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 unique identifier of the MCP tool call item being processed. + */ + item_id: string; + /** + * 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 type of the event. Always 'response.mcp_call.in_progress'. + */ + type: 'response.mcp_call.in_progress'; }; /** @@ -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 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'; }; /** @@ -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 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'; }; /** @@ -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 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'; }; /** @@ -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 output item that was added. + * + */ + item: OutputItem; + /** + * The index of the output item that was added. + * + */ + output_index: number; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.output_item.added`. + * + */ + type: 'response.output_item.added'; }; /** * 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 output item that was marked done. + * + */ + item: OutputItem; + /** + * The index of the output item that was marked done. + * + */ + output_index: number; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.output_item.done`. + * + */ + type: 'response.output_item.done'; }; /** @@ -13322,38 +13722,38 @@ export type ResponseOutputItemDoneEvent = { * * Emitted when an annotation is added to output text content. * - */ -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; - }; + */ +export type ResponseOutputTextAnnotationAddedEvent = { + /** + * The annotation object being added. (See annotation schema for details.) + */ + annotation: { + [key: string]: unknown; + }; + /** + * The index of the annotation within the content part. + */ + annotation_index: number; + /** + * The index of the content part within the output item. + */ + content_index: number; + /** + * 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 sequence number of this event. + */ + sequence_number: number; + /** + * The type of the event. Always 'response.output_text.annotation.added'. + */ + type: 'response.output_text.annotation.added'; }; /** @@ -13365,90 +13765,96 @@ 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'; + /** + * 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; + /** + * 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; + /** + * 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; + prompt?: Prompt; + reasoning?: Reasoning; + /** + * 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; + }; + /** + * 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; + /** + * 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; + /** + * 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'; }; /** @@ -13458,530 +13864,583 @@ export type ResponseProperties = { * */ 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; + /** + * The full response object that is queued. + */ + response: Response; + /** + * The sequence number for this event. + */ + sequence_number: number; + /** + * The type of the event. Always 'response.queued'. + */ + type: 'response.queued'; }; /** * 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. - * + /** + * 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 summary part that was added. + * + */ + part: { + /** + * The text of the summary part. */ - sequence_number: number; + text: string; /** - * The summary part that was added. - * + * The type of the summary part. Always `summary_text`. */ - part: { - /** - * The type of the summary part. Always `summary_text`. - */ - type: 'summary_text'; - /** - * The text of the summary part. - */ - text: string; - }; + type: 'summary_text'; + }; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The type of the event. Always `response.reasoning_summary_part.added`. + * + */ + type: 'response.reasoning_summary_part.added'; }; /** * 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. - * + /** + * 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 completed summary part. + * + */ + part: { + /** + * The text of the summary part. */ - sequence_number: number; + text: string; /** - * The completed summary part. - * + * The type of the summary part. Always `summary_text`. */ - part: { - /** - * The type of the summary part. Always `summary_text`. - */ - type: 'summary_text'; - /** - * The text of the summary part. - */ - text: string; - }; + type: 'summary_text'; + }; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The type of the event. Always `response.reasoning_summary_part.done`. + * + */ + type: 'response.reasoning_summary_part.done'; }; /** * 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 text delta that was added to the summary. + * + */ + delta: string; + /** + * 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 sequence number of this event. + * + */ + sequence_number: number; + /** + * The index of the summary part within the reasoning summary. + * + */ + summary_index: number; + /** + * The type of the event. Always `response.reasoning_summary_text.delta`. + * + */ + type: 'response.reasoning_summary_text.delta'; }; /** * 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 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 sequence number of this event. + * + */ + sequence_number: 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 type of the event. Always `response.reasoning_summary_text.done`. + * + */ + type: 'response.reasoning_summary_text.done'; }; /** * 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 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 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 sequence number of this event. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.reasoning_text.delta`. + * + */ + type: 'response.reasoning_text.delta'; }; /** * 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 index of the reasoning content part. + * + */ + content_index: number; + /** + * 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 sequence number of this event. + * + */ + sequence_number: number; + /** + * The full text of the completed reasoning content. + * + */ + text: string; + /** + * The type of the event. Always `response.reasoning_text.done`. + * + */ + type: 'response.reasoning_text.done'; }; /** * 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 index of the content part that the refusal text is added to. + * + */ + content_index: number; + /** + * The refusal text that is added. + * + */ + delta: string; + /** + * 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 sequence number of this event. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.refusal.delta`. + * + */ + type: 'response.refusal.delta'; }; /** * 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); - -/** - * 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; -}; - -/** - * 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; -}; - -/** - * 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; +export type ResponseRefusalDoneEvent = { + /** + * The index of the content part that the refusal text is finalized. + * + */ + content_index: number; + /** + * 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 refusal text that is finalized. + * + */ + refusal: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; + /** + * The type of the event. Always `response.refusal.done`. + * + */ + type: 'response.refusal.done'; +}; + +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; +}; + +/** + * Emitted when there is an additional text delta. + */ +export type ResponseTextDeltaEvent = { + /** + * 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 ID of the output item that the text delta was added to. + * + */ + item_id: string; + /** + * The log probabilities of the tokens in the delta. + * + */ + logprobs: Array; + /** + * The index of the output item that the text delta was added to. + * + */ + output_index: number; + /** + * The sequence number for this event. + */ + sequence_number: number; + /** + * The type of the event. Always `response.output_text.delta`. + * + */ + type: 'response.output_text.delta'; +}; + +/** + * Emitted when text content is finalized. + */ +export type ResponseTextDoneEvent = { + /** + * The index of the content part that the text content is finalized. + * + */ + content_index: number; + /** + * The ID of the output item that the text content is finalized. + * + */ + item_id: string; + /** + * The log probabilities of the tokens in the delta. + * + */ + logprobs: Array; + /** + * The index of the output item that the text content is finalized. + * + */ + output_index: number; + /** + * The sequence number for this event. + */ + sequence_number: number; + /** + * The text content that is finalized. + * + */ + text: string; + /** + * The type of the event. Always `response.output_text.done`. + * + */ + type: 'response.output_text.done'; }; /** @@ -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; + /** + * Unique ID for the output item associated with the web search call. + * + */ + item_id: string; + /** + * The index of the output item that the web search call is associated with. + * + */ + output_index: number; + /** + * 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'; }; /** * 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; + /** + * Unique ID for the output item associated with the web search call. + * + */ + item_id: string; + /** + * The index of the output item that the web search call is associated with. + * + */ + output_index: number; + /** + * 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'; }; /** * 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; + /** + * Unique ID for the output item associated with the web search call. + * + */ + item_id: string; + /** + * The index of the output item that the web search call is associated with. + * + */ + output_index: number; + /** + * 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'; }; /** * 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; + metadata: { + errors: { + formula_parse_error: boolean; + invalid_variable_error: boolean; + model_grader_parse_error: boolean; + model_grader_refusal_error: boolean; + model_grader_server_error: boolean; + model_grader_server_error_details: string; + other_error: boolean; + python_grader_runtime_error: boolean; + python_grader_runtime_error_details: string; + python_grader_server_error: boolean; + python_grader_server_error_type: string; + sample_parse_error: boolean; + truncated_observation_error: boolean; + unresponsive_reward_error: boolean; + }; + execution_time: number; + name: string; + sampled_model_name: string; + scores: { + [key: string]: unknown; }; + token_usage: number; + type: string; + }; + model_grader_token_usage_per_model: { + [key: string]: unknown; + }; + reward: number; + sub_rewards: { + [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 ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. + */ + assistant_id: string; + /** + * The Unix timestamp (in seconds) for when the run was cancelled. + */ + cancelled_at: number; + /** + * The Unix timestamp (in seconds) for when the run was completed. + */ + completed_at: number; + /** + * The Unix timestamp (in seconds) for when the run was created. + */ + created_at: number; + /** + * The Unix timestamp (in seconds) for when the run will expire. + */ + expires_at: number; + /** + * The Unix timestamp (in seconds) for when the run failed. + */ + failed_at: number; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * 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 instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + */ + instructions: string; + /** + * 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 maximum number of completion tokens specified to have been used over the course of the run. + * + */ + max_completion_tokens: number; + /** + * The maximum number of prompt tokens specified to have been used over the course of the run. + * + */ + max_prompt_tokens: number; + metadata: Metadata; + /** + * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + */ + model: string; + /** + * The object type, which is always `thread.run`. + */ + object: 'thread.run'; + parallel_tool_calls: ParallelToolCalls; + /** + * Details on the action required to continue the run. Will be `null` if no action is required. + */ + required_action: { + /** + * Details on the tool outputs needed for this run to continue. + */ + submit_tool_outputs: { + /** + * A list of the relevant tool calls. + */ + tool_calls: Array; + }; + /** + * For now, this is always `submit_tool_outputs`. + */ + type: 'submit_tool_outputs'; + }; + response_format: AssistantsApiResponseFormatOption; + /** + * The Unix timestamp (in seconds) for when the run was started. + */ + started_at: number; + status: RunStatus; + /** + * The sampling temperature used for this run. If not set, defaults to 1. + */ + temperature?: 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; + tool_choice: AssistantsApiToolChoiceOption & unknown; + /** + * The list of tools that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + */ + tools: Array; + /** + * The nucleus sampling value used for this run. If not set, defaults to 1. + */ + top_p?: number; + truncation_strategy: TruncationObject & unknown; + usage: RunCompletionUsage; }; /** * 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; + 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'; }; /** @@ -14356,16 +14820,16 @@ export type RunStepDeltaObject = { * Details of the message creation by the run step. */ export type RunStepDeltaStepDetailsMessageCreationObject = { + 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; + }; + /** + * Always `message_creation`. + */ + type: 'message_creation'; }; /** @@ -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 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 ID of the tool call. + */ + id?: string; + /** + * The index of the tool call in the tool calls array. + */ + index: number; + /** + * The type of tool call. This is always going to be `code_interpreter` for this type of tool call. + */ + type: 'code_interpreter'; }; /** * Code interpreter image output */ export type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject = { + image?: { /** - * The index of the output in the outputs array. - */ - index: number; - /** - * 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; + }; + /** + * The index of the output in the outputs array. + */ + index: number; + /** + * Always `image`. + */ + type: 'image'; }; /** @@ -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; + /** + * The text output from the Code Interpreter tool call. + */ + logs?: string; + /** + * Always `logs`. + */ + type: 'logs'; }; /** * 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; - }; + /** + * For now, this is always going to be an empty object. + */ + file_search: { + [key: string]: unknown; + }; + /** + * The ID of the tool call object. + */ + id?: string; + /** + * The index of the tool call in the tool calls array. + */ + index: number; + /** + * The type of tool call. This is always going to be `file_search` for this type of tool call. + */ + type: 'file_search'; }; /** * Function tool call */ export type RunStepDeltaStepDetailsToolCallsFunctionObject = { + /** + * The definition of the function that was called. + */ + function?: { /** - * The index of the tool call in the tool calls array. - */ - index: number; - /** - * The ID of the tool call object. + * The arguments passed to the function. */ - id?: string; + arguments?: string; /** - * The type of tool call. This is always going to be `function` for this type of tool call. + * The name of the function. */ - type: 'function'; + name?: 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; + }; + /** + * The ID of the tool call object. + */ + id?: string; + /** + * The index of the tool call in the tool calls array. + */ + index: number; + /** + * The type of tool call. This is always going to be `function` for this type of tool call. + */ + type: 'function'; }; /** @@ -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; + /** + * 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'; }; /** @@ -14527,16 +14994,16 @@ export type RunStepDeltaStepDetailsToolCallsObject = { * Details of the message creation by the run step. */ export type RunStepDetailsMessageCreationObject = { + 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; + }; + /** + * Always `message_creation`. + */ + type: 'message_creation'; }; /** @@ -14545,47 +15012,50 @@ export type RunStepDetailsMessageCreationObject = { * Details of the Code Interpreter tool call the run step was involved in. */ export type RunStepDetailsToolCallsCodeObject = { + /** + * The Code Interpreter tool call definition. + */ + code_interpreter: { /** - * 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 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) + >; + }; + /** + * 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'; }; /** * Code Interpreter image output */ export type RunStepDetailsToolCallsCodeOutputImageObject = { + 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; + }; + /** + * Always `image`. + */ + type: 'image'; }; /** @@ -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; + /** + * The text output from the Code Interpreter tool call. + */ + logs: string; + /** + * Always `logs`. + */ + type: 'logs'; }; /** * File search tool call */ export type RunStepDetailsToolCallsFileSearchObject = { + /** + * 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; + }; + /** + * 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'; }; /** @@ -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,62 +15117,62 @@ export type RunStepDetailsToolCallsFileSearchRankingOptionsObject = { * A result instance of the file search. */ export type RunStepDetailsToolCallsFileSearchResultObject = { + /** + * The content of the result that was found. The content is only included if requested via the include query parameter. + */ + content?: Array<{ /** - * 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 text content of the file. */ - score: number; + text?: string; /** - * The content of the result that was found. The content is only included if requested via the include query parameter. + * The type of the content. */ - content?: Array<{ - /** - * The type of the content. - */ - type?: 'text'; - /** - * The text content of the file. - */ - text?: string; - }>; + type?: 'text'; + }>; + /** + * 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; }; /** * Function tool call */ export type RunStepDetailsToolCallsFunctionObject = { + /** + * The definition of the function that was called. + */ + function: { /** - * The ID of the tool call object. + * The arguments passed to the function. */ - id: string; + arguments: string; /** - * The type of tool call. This is always going to be `function` for this type of tool call. + * The name of the function. */ - type: 'function'; + name: 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; + }; + /** + * 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'; }; /** @@ -14711,15 +15181,15 @@ export type RunStepDetailsToolCallsFunctionObject = { * 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; + /** + * 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'; }; /** @@ -14729,159 +15199,178 @@ export type RunStepDetailsToolCallsObject = { * */ export type RunStepObject = { + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. + */ + assistant_id: string; + /** + * 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 completed. + */ + completed_at: number; + /** + * The Unix timestamp (in seconds) for when the run step was created. + */ + created_at: number; + /** + * 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 failed. + */ + failed_at: number; + /** + * The identifier of the run step, which can be referenced in API endpoints. + */ + id: string; + /** + * 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'; /** - * 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. + * A human-readable description of the error. */ - step_details: ({ + message: string; + }; + metadata: Metadata; + /** + * The object type, which is always `thread.run.step`. + */ + object: 'thread.run.step'; + /** + * 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 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; + } & RunStepDetailsToolCallsObject); + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + */ + thread_id: string; + /** + * The type of run step, which can be either `message_creation` or `tool_calls`. + */ + type: 'message_creation' | 'tool_calls'; + usage: RunStepCompletionUsage; +}; + +export type RunStepStreamEvent = + | { + data: RunStepObject; + event: 'thread.run.step.created'; + } + | { + data: RunStepObject; + event: 'thread.run.step.in_progress'; + } + | { + data: RunStepDeltaObject; + event: 'thread.run.step.delta'; + } + | { + data: RunStepObject; + 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'; + }; + +export type RunStreamEvent = + | { + data: RunObject; + 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'; }; - /** - * 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 function definition. + */ + function: { /** - * 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`. + * The arguments that the model expects you to pass to the function. */ - type: 'function'; + arguments: string; /** - * The function definition. + * The name of the function. */ - function: { - /** - * The name of the function. - */ - name: string; - /** - * The arguments that the model expects you to pass to the function. - */ - arguments: string; - }; + name: string; + }; + /** + * 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'; }; /** @@ -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; + /** + * 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; }; /** @@ -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', + PRIORITY: 'priority', + SCALE: 'scale', } 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; + /** + * A chunk of Base64-encoded audio data. + * + */ + audio: string; + /** + * The type of the event. Always `speech.audio.delta`. + * + */ + type: 'speech.audio.delta'; }; /** * 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 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; }; /** @@ -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; + static: StaticChunkingStrategy; + /** + * Always `static`. + */ + type: 'static'; }; /** * Static Chunking Strategy */ export type StaticChunkingStrategyResponseParam = { - /** - * Always `static`. - */ - type: 'static'; - static: StaticChunkingStrategy; + static: StaticChunkingStrategy; + /** + * Always `static`. + */ + type: 'static'; }; /** @@ -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. + /** + * 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; + /** + * A list of tools for which the outputs are being submitted. + */ + tool_outputs: Array<{ + /** + * The output of the tool call to be submitted to continue the run. */ - 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; - }>; + 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. - * + * The ID of the tool call in the `required_action` object within the run object the output is being submitted for. */ - stream?: boolean; + tool_call_id?: string; + }>; }; /** @@ -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; + /** + * 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'; }; /** @@ -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 Unix timestamp (in seconds) for when the thread was created. + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + metadata: Metadata; + /** + * The object type, which is always `thread`. + */ + object: 'thread'; + /** + * 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; + }; + }; }; /** * 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; + data: ThreadObject; + /** + * Whether to enable input audio transcription. + */ + enabled?: boolean; + event: 'thread.created'; }; 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; - }>; + /** + * 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'; }; /** @@ -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; + /** + * The name of the custom tool to call. + */ + name: string; + /** + * For custom tool calling, the type is always `custom`. + */ + type: 'custom'; }; /** @@ -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; + /** + * The name of the function to call. + */ + name: string; + /** + * For function calling, the type is always `function`. + */ + type: 'function'; }; /** @@ -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; + /** + * The name of the tool to call on the server. + * + */ + name?: string; + /** + * The label of the MCP server to use. + * + */ + server_label: string; + /** + * For MCP tools, the type is always `mcp`. + */ + type: 'mcp'; }; /** @@ -15328,9 +15829,9 @@ export type ToolChoiceMcp = { * */ export const ToolChoiceOptions = { - NONE: 'none', - AUTO: 'auto', - REQUIRED: 'required' + AUTO: 'auto', + NONE: 'none', + 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,94 +15857,100 @@ 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 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`. - * - */ - type: 'transcript.text.delta'; - /** - * The text delta that was additionally transcribed. + * The bytes that were used to generate the log probability. * */ - delta: string; + bytes?: Array; /** - * 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 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 log probability of the token. + * + */ + logprob?: number; + /** + * The token that was used to generate the log probability. + * + */ + token?: string; + }>; + /** + * The type of the event. Always `transcript.text.delta`. + * + */ + type: 'transcript.text.delta'; }; /** * 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 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 bytes that were used to generate the log probability. * */ - type: 'transcript.text.done'; + bytes?: Array; /** - * 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 token that was 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; + token?: string; + }>; + /** + * The text that was transcribed. + * + */ + text: string; + /** + * The type of the event. Always `transcript.text.done`. + * + */ + type: 'transcript.text.done'; + usage?: TranscriptTextUsageTokens; }; /** @@ -15452,14 +15959,14 @@ export type TranscriptTextDoneEvent = { * 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; + /** + * Duration of the input audio in seconds. + */ + seconds: number; + /** + * The type of the usage object. Always `duration` for this variant. + */ + type: 'duration'; }; /** @@ -15468,35 +15975,35 @@ export type TranscriptTextUsageDuration = { * 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; + /** + * Details about the input tokens billed for this request. + */ + input_token_details?: { + /** + * Number of audio tokens billed for this request. + */ + audio_tokens?: number; + /** + * Number of text tokens billed for this request. + */ + text_tokens?: number; + }; + /** + * Number of input tokens billed for this request. + */ + input_tokens: number; + /** + * Number of output tokens generated. + */ + output_tokens: number; + /** + * Total number of tokens used (input + output). + */ + total_tokens: number; + /** + * The type of the usage object. Always `tokens` for this variant. + */ + type: 'tokens'; }; /** @@ -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; + /** + * 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; + /** + * End time of the segment in seconds. + */ + end: number; + /** + * Unique identifier of the segment. + */ + id: 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; + /** + * Seek offset of the segment. + */ + seek: number; + /** + * Start time of the segment in seconds. + */ + start: number; + /** + * Temperature parameter used for generating the segment. + */ + temperature: number; + /** + * Text content of the segment. + */ + text: string; + /** + * Array of token IDs for the text content. + */ + tokens: Array; }; 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; + /** + * End time of the word in seconds. + */ + end: number; + /** + * Start time of the word in seconds. + */ + start: number; + /** + * The text content of the word. + */ + word: string; }; /** @@ -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 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'; }; /** @@ -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; + /** + * The text to type. + * + */ + text: string; + /** + * Specifies the event type. For a type action, this property is + * always set to `type`. + * + */ + type: 'type'; }; export type UpdateVectorStoreFileAttributesRequest = { - attributes: VectorStoreFileAttributes; + attributes: VectorStoreFileAttributes; }; export type UpdateVectorStoreRequest = { - /** - * The name of the vector store. - */ - name?: string; - expires_after?: VectorStoreExpirationAfter & unknown; - metadata?: Metadata; + expires_after?: VectorStoreExpirationAfter & unknown; + metadata?: Metadata; + /** + * The name of the vector store. + */ + name?: string; }; /** @@ -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 intended number of bytes to be uploaded. + */ + bytes: number; + /** + * The Unix timestamp (in seconds) for when the Upload was created. + */ + created_at: number; + /** + * The Unix timestamp (in seconds) for when the Upload will expire. + */ + expires_at: number; + file?: OpenAiFile & unknown; + /** + * The name of the file to be uploaded. + */ + filename: string; + /** + * The Upload unique identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always "upload". + */ + object: 'upload'; + /** + * 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'; }; export type UploadCertificateRequest = { - /** - * An optional name for the certificate - */ - name?: string; - /** - * The certificate content in PEM format - */ - content: string; + /** + * The certificate content in PEM format + */ + content: string; + /** + * An optional name for the certificate + */ + name?: string; }; /** @@ -15675,396 +16182,406 @@ 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 Unix timestamp (in seconds) for when the Part was created. + */ + created_at: number; + /** + * The upload Part unique identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The object type, which is always `upload.part`. + */ + object: 'upload.part'; + /** + * The ID of the Upload object that this Part was added to. + */ + upload_id: string; }; /** * 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; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * The number of characters processed. + */ + characters: number; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + object: 'organization.usage.audio_speeches.result'; + /** + * 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; }; /** * 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; + /** + * 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 count of requests made to the model. + */ + num_model_requests: number; + object: 'organization.usage.audio_transcriptions.result'; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * The number of seconds processed. + */ + seconds: number; + /** + * When `group_by=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: 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; + /** + * The number of code interpreter sessions. + */ + num_sessions?: number; + object: 'organization.usage.code_interpreter_sessions.result'; + /** + * 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; + /** + * 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=batch`, this field tells whether the grouped usage result is batch or not. + */ + batch?: boolean; + /** + * The aggregated number of audio input tokens used, including cached tokens. + */ + input_audio_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 input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. + */ + input_tokens: number; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + object: 'organization.usage.completions.result'; + /** + * The aggregated number of audio output tokens used. + */ + output_audio_tokens?: number; + /** + * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. + */ + output_tokens: 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; }; /** * 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; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * The aggregated number of input tokens used. + */ + input_tokens: number; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + object: 'organization.usage.embeddings.result'; + /** + * 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; }; /** * 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; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * The number of images processed. + */ + images: number; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + object: 'organization.usage.images.result'; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * When `group_by=size`, this field provides the image size of the grouped usage result. + */ + size?: string; + /** + * 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=user_id`, this field provides the user ID of the grouped usage result. + */ + user_id?: 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; + /** + * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. + */ + api_key_id?: string; + /** + * The aggregated number of input tokens used. + */ + input_tokens: number; + /** + * When `group_by=model`, this field provides the model name of the grouped usage result. + */ + model?: string; + /** + * The count of requests made to the model. + */ + num_model_requests: number; + object: 'organization.usage.moderations.result'; + /** + * 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; }; export type UsageResponse = { - object: 'page'; - data: Array; - has_more: boolean; - next_page: string; + data: Array; + has_more: boolean; + next_page: string; + object: 'page'; }; export type UsageTimeBucket = { - object: 'bucket'; - start_time: number; - end_time: number; - result: Array<({ + end_time: number; + object: 'bucket'; + 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) + >; + start_time: number; }; /** * 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'; + /** + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + */ + project_id?: string; + /** + * The vector stores usage in bytes. + */ + usage_bytes: number; }; /** - * 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; + * Represents an individual `user` within an organization. + */ +export type User = { + /** + * The Unix timestamp (in seconds) of when the user was added. + */ + added_at: number; + /** + * The email address of the user + */ + email: string; + /** + * The identifier, which can be referenced in API endpoints + */ + id: string; + /** + * The name of the user + */ + name: string; + /** + * The object type, which is always `organization.user` + */ + object: 'organization.user'; + /** + * `owner` or `reader` + */ + role: 'owner' | 'reader'; }; export type UserDeleteResponse = { - object: 'organization.user.deleted'; - id: string; - deleted: boolean; + deleted: boolean; + id: string; + object: 'organization.user.deleted'; }; export type UserListResponse = { - object: 'list'; - data: Array; - first_id: string; - last_id: string; - has_more: boolean; + data: Array; + first_id: string; + has_more: boolean; + last_id: string; + object: 'list'; }; 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; + /** + * 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'; }; /** * 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; }; /** @@ -16073,14 +16590,14 @@ export type ValidateGraderResponse = { * 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; + /** + * 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 Unix timestamp (in seconds) for when the vector store files batch was created. + */ + created_at: number; + file_counts: { /** - * The identifier, which can be referenced in API endpoints. + * The number of files that where cancelled. */ - id: string; + cancelled: number; /** - * The object type, which is always `vector_store.file_batch`. + * 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 are currently being processed. */ - vector_store_id: string; + in_progress: 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; + }; + /** + * 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 status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. + */ + status: 'in_progress' | 'completed' | 'cancelled' | 'failed'; + /** + * 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; }; /** * Represents the parsed content of a vector store file. */ export type VectorStoreFileContentResponse = { + /** + * 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. - */ - data: Array<{ - /** - * The content type (currently only `"text"`) - */ - type?: string; - /** - * The text content - */ - text?: string; - }>; - /** - * Indicates if there are more content pages to fetch. + * The text content */ - has_more: boolean; + text?: string; /** - * The token for the next page, if any. + * The content type (currently only `"text"`) */ - next_page: string; + type?: string; + }>; + /** + * Indicates if there are more content pages to fetch. + */ + has_more: boolean; + /** + * The token for the next page, if any. + */ + next_page: string; + /** + * The object type, which is always `vector_store.file_content.page` + */ + object: 'vector_store.file_content.page'; }; /** @@ -16182,45 +16699,45 @@ export type VectorStoreFileContentResponse = { * A list of files attached to a vector store. */ export type VectorStoreFileObject = { + attributes?: VectorStoreFileAttributes; + chunking_strategy?: ChunkingStrategyResponse; + /** + * The Unix timestamp (in seconds) for when the vector store file was created. + */ + created_at: number; + /** + * The identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * 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; + }; + /** + * The object type, which is always `vector_store.file`. + */ + object: 'vector_store.file'; + /** + * 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 total vector store usage in bytes. Note that this may be different from the original file size. + */ + usage_bytes: 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; }; /** @@ -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 Unix timestamp (in seconds) for when the vector store was created. + */ + created_at: number; + expires_after?: VectorStoreExpirationAfter; + /** + * The Unix timestamp (in seconds) for when the vector store will expire. + */ + expires_at?: number; + file_counts: { /** - * 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 number of files that were cancelled. */ - name: string; + cancelled: number; /** - * The total number of bytes used by the files in the vector store. + * The number of files that have been successfully processed. */ - 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 are currently being processed. */ - expires_at?: number; + in_progress: 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 identifier, which can be referenced in API endpoints. + */ + id: string; + /** + * The Unix timestamp (in seconds) for when the vector store was last active. + */ + last_active_at: number; + metadata: Metadata; + /** + * The name of the vector store. + */ + name: string; + /** + * The object type, which is always `vector_store`. + */ + object: 'vector_store'; + /** + * 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'; + /** + * The total number of bytes used by the files in the vector store. + */ + usage_bytes: number; }; 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 filter to apply based on file attributes. + */ + filters?: ComparisonFilter | CompoundFilter; + /** + * The maximum number of results to return. This number should be between 1 and 50 inclusive. + */ + max_num_results?: number; + /** + * A query string for a search + */ + query: string | Array; + /** + * 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; + }; + /** + * Whether to rewrite the natural language query for vector search. + */ + rewrite_query?: boolean; }; export type VectorStoreSearchResultContentObject = { - /** - * The type of content. - */ - type: 'text'; - /** - * The text content returned from search. - */ - text: string; + /** + * The text content returned from search. + */ + text: string; + /** + * The type of content. + */ + type: 'text'; }; 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; + 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; }; 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 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; }; /** @@ -16374,9 +16891,9 @@ export type VectorStoreSearchResultsPage = { * */ export const Verbosity = { - LOW: 'low', - MEDIUM: 'medium', - HIGH: 'high' + HIGH: 'high', + LOW: 'low', + MEDIUM: 'medium', } 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 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; }; /** @@ -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 search query. + * + */ + query: string; + /** + * The action type. + * + */ + type: 'search'; }; /** @@ -16472,9 +16998,9 @@ export type WebSearchActionSearch = { * */ export const WebSearchContextSize = { - LOW: 'low', - MEDIUM: 'medium', - HIGH: 'high' + HIGH: 'high', + LOW: 'low', + MEDIUM: 'medium', } 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; + /** + * Free text input for the city of the user, e.g. `San Francisco`. + * + */ + city?: 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; + /** + * 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: ({ + /** + * 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); + /** + * The unique ID of the web search tool call. + * + */ + id: string; + /** + * The status of the web search tool call. + * + */ + status: 'in_progress' | 'searching' | 'completed' | 'failed'; + /** + * The type of the web search tool call. Always `web_search_call`. + * + */ + type: 'web_search_call'; }; /** @@ -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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the batch API request was cancelled. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `batch.cancelled`. + * + */ + type: 'batch.cancelled'; }; /** @@ -16599,77 +17128,77 @@ export type WebhookBatchCancelled = { * */ export type WebhookBatchCompleted = { + /** + * The Unix timestamp (in seconds) of when the batch API request was completed. + * + */ + created_at: number; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the batch API request was completed. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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'; +/** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The type of the event. Always `batch.expired`. + * The unique ID of the batch API request. * */ - type: 'batch.expired'; + id: string; + }; + /** + * The unique ID of the event. + * + */ + id: string; + /** + * The object of the event. Always `event`. + * + */ + object?: 'event'; + /** + * The type of the event. Always `batch.expired`. + * + */ + type: 'batch.expired'; }; /** @@ -16679,37 +17208,37 @@ export type WebhookBatchExpired = { * */ export type WebhookBatchFailed = { + /** + * The Unix timestamp (in seconds) of when the batch API request failed. + * + */ + created_at: number; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the batch API request failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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.failed`. - * - */ - type: 'batch.failed'; + }; + /** + * The unique ID of the event. + * + */ + 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the eval run was canceled. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the eval run failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the eval run succeeded. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the fine-tuning job was cancelled. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + 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'; }; /** @@ -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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the fine-tuning job failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + 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'; }; /** @@ -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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the fine-tuning job succeeded. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + 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'; }; /** @@ -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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the model response was cancelled. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the model response was completed. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the model response failed. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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; + /** + * Event data payload. + * + */ + data: { /** - * The Unix timestamp (in seconds) of when the model response was interrupted. - * - */ - created_at: number; - /** - * The unique ID of the event. + * 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 unique ID of the event. + * + */ + id: string; + /** + * 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 text input to the model. + */ + text: string; + /** + * The type of the input item. Always `input_text`. + */ + type: 'input_text'; }; /** @@ -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 detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + */ + detail: 'low' | 'high' | 'auto'; + file_id?: string | null; + image_url?: string | null; + /** + * The type of the input item. Always `input_image`. + */ + type: 'input_image'; }; /** @@ -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 content of the file to be sent to the model. + * + */ + file_data?: string; + file_id?: string | null; + /** + * The URL of the file to be sent to the model. + */ + file_url?: string; + /** + * The name of the file to be sent to the model. + */ + filename?: string; + /** + * The type of the input item. Always `input_file`. + */ + type: 'input_file'; }; /** @@ -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; + description?: string | null; + /** + * The name of the function to call. + */ + name: string; + parameters: { + [key: string]: unknown; + } | null; + strict: boolean | null; + /** + * The type of the function tool. Always `function`. + */ + type: 'function'; }; 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; + filters?: Filters | null; + /** + * 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; + /** + * 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; }; export type ApproximateLocation = { - /** - * The type of location approximation. Always `approximate`. - */ - type: 'approximate'; - country?: string | null; - region?: string | null; - city?: string | null; - timezone?: string | null; + city?: string | null; + country?: string | null; + region?: string | null; + timezone?: string | null; + /** + * The type of location approximation. Always `approximate`. + */ + type: 'approximate'; }; /** @@ -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'; + /** + * 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; }; -/** - * 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 height of the computer display. + */ + display_height: number; + /** + * The width of the computer display. + */ + display_width: number; + /** + * The type of computer environment to control. + */ + environment: 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser'; + /** + * The type of the computer use tool. Always `computer_use_preview`. + */ + type: 'computer_use_preview'; }; /** @@ -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 image tokens in the input prompt. + */ + image_tokens: number; + /** + * The number of text tokens in the input prompt. + */ + text_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; + input_tokens_details: ImageGenInputUsageDetails; + /** + * The number of output tokens generated by the model. + */ + output_tokens: number; + /** + * The total number of tokens (images and text) used for the image generation. + */ + total_tokens: number; }; /** @@ -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 ID of the file. + */ + file_id: string; + /** + * The filename of the file cited. + */ + filename: string; + /** + * The index of the file in the list of files. + */ + index: number; + /** + * The type of the file citation. Always `file_citation`. + */ + type: 'file_citation'; }; /** @@ -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 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 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; }; /** @@ -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 ID of the container file. + */ + container_id: string; + /** + * The index of the last character of the container file citation in the message. + */ + end_index: number; + /** + * The ID of the file. + */ + file_id: string; + /** + * The filename of the container file cited. + */ + filename: string; + /** + * The index of the first character of the container file citation in the message. + */ + start_index: number; + /** + * The type of the container file citation. Always `container_file_citation`. + */ + type: 'container_file_citation'; +}; + +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; + bytes: Array; + logprob: number; + token: string; }; /** @@ -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; + bytes: Array; + logprob: number; + token: string; + 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 annotations of the text output. + */ + annotations: Array; + logprobs?: Array; + /** + * The text output from the model. + */ + text: string; + /** + * The type of the output text. Always `output_text`. + */ + type: 'output_text'; }; /** @@ -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 refusal explanation from the model. + */ + refusal: string; + /** + * The type of the refusal. Always `refusal`. + */ + type: 'refusal'; }; /** * 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; + code?: string | null; + /** + * The ID of the pending safety check. + */ + id: string; + 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; + acknowledged_safety_checks?: Array | null; + /** + * The ID of the computer tool call that produced the output. + */ + call_id: string; + id?: string | null; + output: ComputerScreenshotImage; + status?: 'in_progress' | 'completed' | 'incomplete' | null; + /** + * The type of the computer tool call output. Always `computer_call_output`. + */ + type: 'computer_call_output'; }; /** @@ -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; + /** + * The unique ID of the function tool call generated by the model. + */ + call_id: string; + id?: string | null; + /** + * A JSON string of the output of the function tool call. + */ + output: string; + status?: 'in_progress' | 'completed' | 'incomplete' | null; + /** + * The type of the function tool call output. Always `function_call_output`. + */ + type: 'function_call_output'; }; /** @@ -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; + /** + * The ID of the item to reference. + */ + id: string; + type?: 'item_reference' | null; }; 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; + /** + * Base64-encoded audio bytes, used for `input_audio` content type. + * + */ + audio?: 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; + /** + * The text content, used for `input_text` and `text` content types. + * + */ + text?: 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'; }; export type RealtimeConnectParams = { - model: string; + model: string; }; /** * An object describing an image to classify. */ export type ModerationImageUrlInput = { + /** + * 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; + }; + /** + * Always `image_url`. + */ + type: 'image_url'; }; /** * An object describing text to classify. */ export type ModerationTextInput = { - /** - * Always `text`. - */ - type: 'text'; - /** - * A string of text to classify. - */ - text: string; + /** + * A string of text to classify. + */ + text: string; + /** + * Always `text`. + */ + type: 'text'; }; /** * 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', + EVALS: 'evals', + FINE_TUNE: 'fine-tune', + USER_DATA: 'user_data', + VISION: 'vision', } 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; + /** + * The line number of the input file where the error occurred, if applicable. + */ + line?: number; + /** + * 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 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); + /** + * Number of requests that have been completed successfully. + */ + completed: number; + /** + * Number of requests that have failed. + */ + failed: number; + /** + * Total number of requests in the batch. + */ + total: 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_4_1: 'gpt-4.1', + GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', + GPT_4_1_MINI: 'gpt-4.1-mini', + GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', + GPT_4_1_NANO: 'gpt-4.1-nano', + GPT_4O: 'gpt-4o', + GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', + GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', + GPT_5: 'gpt-5', + GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', + GPT_5_2025_08_07: 'gpt-5-2025-08-07', + GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', + GPT_5_CHAT_LATEST: 'gpt-5-chat-latest', + GPT_4O_AUDIO_PREVIEW: 'gpt-4o-audio-preview', + GPT_5_MINI: 'gpt-5-mini', + GPT_4O_AUDIO_PREVIEW_2024_10_01: 'gpt-4o-audio-preview-2024-10-01', + GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', + GPT_4O_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-audio-preview-2024-12-17', + GPT_5_NANO: 'gpt-5-nano', + GPT_4O_AUDIO_PREVIEW_2025_06_03: 'gpt-4o-audio-preview-2025-06-03', + GPT_5_NANO_2025_08_07: 'gpt-5-nano-2025-08-07', + CHATGPT_4O_LATEST: 'chatgpt-4o-latest', + O1: 'o1', + CODEX_MINI_LATEST: 'codex-mini-latest', + O1_2024_12_17: 'o1-2024-12-17', + GPT_4O_MINI: 'gpt-4o-mini', + O1_MINI: 'o1-mini', + GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', + O3: 'o3', + GPT_4: 'gpt-4', + O3_2025_04_16: 'o3-2025-04-16', + GPT_4O_MINI_AUDIO_PREVIEW: 'gpt-4o-mini-audio-preview', + O4_MINI: 'o4-mini', + GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-mini-audio-preview-2024-12-17', + O4_MINI_2025_04_16: 'o4-mini-2025-04-16', + GPT_3_5_TURBO: 'gpt-3.5-turbo', + O3_MINI: 'o3-mini', + GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301', + O3_MINI_2025_01_31: 'o3-mini-2025-01-31', + GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', + O1_PREVIEW: 'o1-preview', + GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', + O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12', + GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', + O1_MINI_2024_09_12: 'o1-mini-2024-09-12', + GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', + GPT_4O_MINI_SEARCH_PREVIEW: 'gpt-4o-mini-search-preview', + GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613', + GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-mini-search-preview-2025-03-11', + GPT_4O_SEARCH_PREVIEW: 'gpt-4o-search-preview', + GPT_4O_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-search-preview-2025-03-11', + GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', + GPT_4_0314: 'gpt-4-0314', + GPT_4_0613: 'gpt-4-0613', + GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', + GPT_4_32K: 'gpt-4-32k', + GPT_4_32K_0314: 'gpt-4-32k-0314', + GPT_4_32K_0613: 'gpt-4-32k-0613', + GPT_4_TURBO: 'gpt-4-turbo', + GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09', + GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview', + GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', } 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; + /** + * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. + */ + instructions?: string; + /** + * 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; + /** + * 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; + metadata?: Metadata; + /** + * 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'; + parallel_tool_calls?: ParallelToolCalls; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + thread?: CreateThreadRequest; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + /** + * 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; + }; + }; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + /** + * 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; + truncation_strategy?: TruncationObject & unknown; }; 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; + /** + * 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; + /** + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. + */ + assistant_id: string; + /** + * 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; + /** + * 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; + /** + * 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; + metadata?: Metadata; + /** + * 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; + parallel_tool_calls?: ParallelToolCalls; + reasoning_effort?: ReasoningEffort; + response_format?: AssistantsApiResponseFormatOption; + /** + * 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; + tool_choice?: AssistantsApiToolChoiceOption & unknown; + /** + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + */ + tools?: Array; + /** + * 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; + truncation_strategy?: TruncationObject & unknown; }; 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 output of the tool call to be submitted to continue the run. */ - 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; - }>; + output?: string; + /** + * 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 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' + CANCELLED: 'cancelled', + CANCELLING: 'cancelling', + COMPLETED: 'completed', + EXPIRED: 'expired', + FAILED: 'failed', + INCOMPLETE: 'incomplete', + IN_PROGRESS: 'in_progress', + QUEUED: 'queued', + REQUIRES_ACTION: 'requires_action', } 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 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 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'; + }; + 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 time frame within which the batch should be processed. Currently only `24h` is supported. + */ + completion_window: '24h'; + /** + * 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 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; + 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?: { + /** + * Identifier for the last chat completion from the previous pagination request. + */ + after?: string; + /** + * Number of Chat Completions to retrieve. + */ + limit?: number; + /** + * A list of metadata keys to filter the Chat Completions by. Example: + * + * `metadata[key1]=value1&metadata[key2]=value2` + * + */ + metadata?: Metadata; + /** + * The model used to generate the Chat Completions. + */ + model?: string; + /** + * 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 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; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + }; + 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 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; + /** + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * + */ + order?: 'asc' | 'desc'; + }; + 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: { + deleted: boolean; + eval_id: string; + object: 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: { + metadata?: Metadata; /** - * 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; + }; + 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: { + deleted?: boolean; + object?: string; + 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; + /** + * Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. + */ + order?: 'asc' | 'desc'; + /** + * Filter output items by status. Use `failed` to filter by failed output + * items or `pass` to filter by passed output items. + * + */ + status?: 'fail' | 'pass'; + }; + 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 output item to retrieve. + */ + output_item_id: string; + /** + * The ID of the run to retrieve. + */ + run_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?: { + /** + * 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 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'; + /** + * Only return files with the given purpose. + */ + purpose?: 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?: { + /** + * Identifier for the last permission ID from the previous pagination request. + */ + after?: string; + /** + * Number of permissions to retrieve. + */ + limit?: number; /** - * OK + * The order in which to retrieve permissions. */ - 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'; + order?: 'ascending' | 'descending'; + /** + * The ID of the project to get permissions for. + */ + project_id?: string; + }; + 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; + /** + * Maximum number of keys to return. + */ + limit?: number; + /** + * Order results by creation time, ascending or descending. + */ + order?: 'asc' | 'desc'; + }; + 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: { + deleted?: boolean; + id?: string; + object?: string; + }; }; -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 performed by users with these emails. + */ + 'actor_emails[]'?: 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; + /** + * 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; + /** + * 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 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; + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * + */ + limit?: number; + /** + * Return only events for these projects. + */ + 'project_ids[]'?: Array; + /** + * Return only events performed on these targets. For example, a project ID updated. + */ + 'resource_ids[]'?: Array; + }; + 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 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; + /** + * 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: { + /** + * Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. + */ + bucket_width?: '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only costs for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + }; + 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 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: '/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 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; + /** + * 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: '/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 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: '/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 API key. + */ + key_id: string; + /** + * The ID of the project. + */ + project_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 API key. + */ + key_id: string; + /** + * The ID of the project. + */ + project_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 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; + /** + * 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 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; + /** + * A limit on the number of objects to be returned. The default is 100. + * + */ + limit?: number; + }; + 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 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: '/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 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: '/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: { + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * Return only usage for these users. + */ + user_ids?: Array; + }; + 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: { + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; /** - * Usage data retrieved successfully. + * Return only usage for these users. */ - 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'; + user_ids?: Array; + }; + 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: { + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + }; + 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: { + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. + * + */ + batch?: boolean; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * Return only usage for these users. + */ + user_ids?: Array; + }; + 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: { + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * Return only usage for these users. + */ + user_ids?: Array; + }; + 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: { + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * 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 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'>; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * Return only usage for these users. + */ + user_ids?: Array; + }; + 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: { + /** + * Return only usage for these API keys. + */ + api_key_ids?: Array; + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these models. + */ + models?: Array; + /** + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + */ + page?: string; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + /** + * Return only usage for these users. + */ + user_ids?: Array; + }; + 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: { + /** + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + */ + bucket_width?: '1m' | '1h' | '1d'; + /** + * End time (Unix seconds) of the query time range, exclusive. + */ + end_time?: number; + /** + * 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; + /** + * Return only usage for these projects. + */ + project_ids?: Array; + /** + * Start time (Unix seconds) of the query time range, inclusive. + */ + start_time: number; + }; + 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 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; + /** + * 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: '/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; + /** + * 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; + /** + * The sequence number of the event after which to start streaming. + * + */ + starting_after?: 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 below](https://platform.openai.com/docs/api-reference/responses-streaming) + * for more information. + * + */ + stream?: 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?: { + /** + * 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; + /** + * 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'; + }; + 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 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 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'; + /** + * 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 message to delete. + */ + message_id: string; + /** + * The ID of the thread to which this message belongs. + */ + thread_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 message to retrieve. + */ + message_id: string; + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this message belongs. + */ + thread_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 message to modify. + */ + message_id: string; + /** + * The ID of the thread to which this message belongs. + */ + thread_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 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 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'; + }; + 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 run to retrieve. + */ + run_id: string; + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + */ + thread_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 run to modify. + */ + run_id: string; + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + */ + thread_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 run to cancel. + */ + run_id: string; + /** + * The ID of the thread to which this run belongs. + */ + thread_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 run the run steps belong to. + */ + run_id: string; + /** + * The ID of the thread the run and run steps belong to. + */ + thread_id: string; + }; + 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 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'>; + /** + * 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'; + }; + 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 run to which the run step belongs. + */ + run_id: string; + /** + * The ID of the run step to retrieve. + */ + step_id: string; + /** + * The ID of the thread to which the run and run step belongs. + */ + 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/{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 run that requires the tool output submission. + */ + run_id: string; + /** + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) to which this run belongs. + */ + thread_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 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 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'; + }; + 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 file batch being retrieved. + */ + batch_id: string; + /** + * The ID of the vector store that the file batch belongs to. + */ + vector_store_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 file batch to cancel. + */ + batch_id: string; + /** + * The ID of the vector store that the file batch belongs to. + */ + vector_store_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 file batch that the files belong to. + */ + batch_id: string; + /** + * The ID of the vector store that the files belong to. + */ + vector_store_id: string; + }; + 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 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'; + /** + * 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'; + }; + 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 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'; + /** + * 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'; + }; + 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 file to delete. + */ + file_id: string; + /** + * The ID of the vector store that the file belongs to. + */ + vector_store_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 file being retrieved. + */ + file_id: string; + /** + * The ID of the vector store that the file belongs to. + */ + vector_store_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 file to update attributes. + */ + file_id: string; + /** + * The ID of the vector store the file belongs to. + */ + vector_store_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 file within the vector store. + */ + file_id: string; + /** + * The ID of the vector store. + */ + vector_store_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-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 = { From b73bae4d9beb1966ba908e4e030b8796fa9a7811 Mon Sep 17 00:00:00 2001 From: Lubos Date: Sat, 4 Apr 2026 11:41:39 +0200 Subject: [PATCH 10/10] chore: generate examples --- .../src/client/@angular/common.gen.ts | 38 +- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../openapi-ts-axios/src/client/types.gen.ts | 22 +- .../src/client/fastify.gen.ts | 6 +- .../src/client/schemas.gen.ts | 126 +- .../openapi-ts-fetch/src/client/types.gen.ts | 22 +- .../openapi-ts-ky/src/client/schemas.gen.ts | 126 +- .../openapi-ts-ky/src/client/types.gen.ts | 22 +- .../src/client/nestjs.gen.ts | 2 +- .../openapi-ts-nestjs/src/client/types.gen.ts | 4 +- .../openapi-ts-next/src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../openapi-ts-ofetch/src/client/types.gen.ts | 22 +- .../openapi-ts-openai/src/client/types.gen.ts | 10608 ++++++++-------- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- .../src/client/schemas.gen.ts | 126 +- .../src/client/types.gen.ts | 22 +- 28 files changed, 6154 insertions(+), 6154 deletions(-) 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-nestjs/src/client/nestjs.gen.ts b/examples/openapi-ts-nestjs/src/client/nestjs.gen.ts index fbfb295933..a754da6e5e 100644 --- a/examples/openapi-ts-nestjs/src/client/nestjs.gen.ts +++ b/examples/openapi-ts-nestjs/src/client/nestjs.gen.ts @@ -15,9 +15,9 @@ import type { } from './types.gen'; export type PetsControllerMethods = { + listPets: (query?: ListPetsData['query']) => Promise; createPet: (body: CreatePetData['body']) => Promise; deletePet: (path: DeletePetData['path']) => Promise; - listPets: (query?: ListPetsData['query']) => Promise; showPetById: (path: ShowPetByIdData['path']) => Promise; updatePet: ( path: UpdatePetData['path'], diff --git a/examples/openapi-ts-nestjs/src/client/types.gen.ts b/examples/openapi-ts-nestjs/src/client/types.gen.ts index 0c5904f24a..8bfc020de2 100644 --- a/examples/openapi-ts-nestjs/src/client/types.gen.ts +++ b/examples/openapi-ts-nestjs/src/client/types.gen.ts @@ -7,8 +7,8 @@ export type ClientOptions = { export type Pet = { id: string; name: string; - status?: 'available' | 'pending' | 'sold'; tag?: string; + status?: 'available' | 'pending' | 'sold'; }; export type CreatePetBody = { @@ -18,8 +18,8 @@ export type CreatePetBody = { export type UpdatePetBody = { name?: string; - status?: 'available' | 'pending' | 'sold'; tag?: string; + status?: 'available' | 'pending' | 'sold'; }; export type Error = { 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/types.gen.ts b/examples/openapi-ts-openai/src/client/types.gen.ts index a06b9cd241..52a933d971 100644 --- a/examples/openapi-ts-openai/src/client/types.gen.ts +++ b/examples/openapi-ts-openai/src/client/types.gen.ts @@ -33,30 +33,42 @@ export type AddUploadPartRequest = { */ export type AdminApiKey = { /** - * The Unix timestamp (in seconds) of when the API key was created + * The object type, which is always `organization.admin_api_key` */ - created_at: number; + object: string; /** * The identifier, which can be referenced in API endpoints */ id: string; - /** - * The Unix timestamp (in seconds) of when the API key was last used - */ - last_used_at: number; /** * The name of the API key */ name: string; /** - * The object type, which is always `organization.admin_api_key` + * The redacted value of the API key */ - object: string; + 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: { /** - * The Unix timestamp (in seconds) of when the user was created + * Always `user` */ - created_at?: number; + type?: string; + /** + * The object type, which is always organization.user + */ + object?: string; /** * The identifier, which can be referenced in API endpoints */ @@ -66,34 +78,22 @@ export type AdminApiKey = { */ name?: string; /** - * The object type, which is always organization.user + * The Unix timestamp (in seconds) of when the user was created */ - object?: string; + created_at?: number; /** * Always `owner` */ role?: string; - /** - * Always `user` - */ - type?: string; }; - /** - * The redacted value of the API key - */ - redacted_value: string; - /** - * The value of the API key. Only shown on create. - */ - value?: string; }; export type ApiKeyList = { + object?: string; data?: Array; - first_id?: string; has_more?: boolean; + first_id?: string; last_id?: string; - object?: string; }; /** @@ -102,45 +102,43 @@ 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 description of the assistant. The maximum length is 512 characters. + * The name of the assistant. The maximum length is 256 characters. * */ - description: string; - /** - * The identifier, which can be referenced in API endpoints. - */ - id: string; + name: string; /** - * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * The description of the assistant. The maximum length is 512 characters. * */ - instructions: string; - metadata: Metadata; + 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 name of the assistant. The maximum length is 256 characters. + * The system instructions that the assistant uses. The maximum length is 256,000 characters. * */ - name: string; - /** - * The object type, which is always `assistant`. - */ - object: 'assistant'; - response_format?: AssistantsApiResponseFormatOption; + instructions: 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. + * 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`. * */ - temperature?: number; + 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. * @@ -161,11 +159,12 @@ export type AssistantObject = { vector_store_ids?: Array; }; }; + metadata: Metadata; /** - * 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`. + * 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. * */ - tools: Array; + 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. * @@ -173,6 +172,7 @@ export type AssistantObject = { * */ top_p?: number; + response_format?: AssistantsApiResponseFormatOption; }; /** @@ -215,48 +215,48 @@ export type AssistantStreamEvent = } & ErrorEvent); export const AssistantSupportedModels = { - GPT_4O: 'gpt-4o', - GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', - GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', - GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', - GPT_4_1: 'gpt-4.1', - GPT_4O_MINI: 'gpt-4o-mini', - GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', - GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', - GPT_4_1_MINI: 'gpt-4.1-mini', - GPT_4_0125_PREVIEW: 'gpt-4-0125-preview', - GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', - GPT_4: 'gpt-4', - GPT_4_1_NANO: 'gpt-4.1-nano', - GPT_4_0314: 'gpt-4-0314', GPT_5: 'gpt-5', - GPT_4_0613: 'gpt-4-0613', - GPT_5_2025_08_07: 'gpt-5-2025-08-07', - GPT_3_5_TURBO: 'gpt-3.5-turbo', GPT_5_MINI: 'gpt-5-mini', - GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', - GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', - GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', GPT_5_NANO: 'gpt-5-nano', - GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', - GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', + 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_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613', + 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', - GPT_4_1106_PREVIEW: 'gpt-4-1106-preview', - O1: 'o1', - GPT_4_32K: 'gpt-4-32k', O3_MINI: 'o3-mini', - GPT_4_32K_0314: 'gpt-4-32k-0314', O3_MINI_2025_01_31: 'o3-mini-2025-01-31', - GPT_4_32K_0613: 'gpt-4-32k-0613', + 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 = @@ -276,6 +276,10 @@ export type AssistantToolsCode = { * FileSearch tool */ export type AssistantToolsFileSearch = { + /** + * The type of tool being defined: `file_search` + */ + type: 'file_search'; /** * Overrides for the file search tool. */ @@ -289,10 +293,6 @@ export type AssistantToolsFileSearch = { max_num_results?: number; ranking_options?: FileSearchRankingOptions; }; - /** - * The type of tool being defined: `file_search` - */ - type: 'file_search'; }; /** @@ -309,11 +309,11 @@ export type AssistantToolsFileSearchTypeOnly = { * Function tool */ export type AssistantToolsFunction = { - function: FunctionObject; /** * The type of tool being defined: `function` */ type: 'function'; + function: FunctionObject; }; /** @@ -350,16 +350,16 @@ export type AssistantsApiToolChoiceOption = * 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 name of the function to call. */ name: string; }; - /** - * The type of the tool. If type is `function`, the function name must be set - */ - type: 'function' | 'code_interpreter' | 'file_search'; }; /** @@ -368,8 +368,8 @@ export type AssistantsNamedToolChoice = { */ export const AudioResponseFormat = { JSON: 'json', - SRT: 'srt', TEXT: 'text', + SRT: 'srt', VERBOSE_JSON: 'verbose_json', VTT: 'vtt', } as const; @@ -384,11 +384,37 @@ export type AudioResponseFormat = (typeof AudioResponseFormat)[keyof typeof Audi * 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 project title. + */ + name?: string; + }; actor: AuditLogActor; /** * The details for events with this `type`. */ 'api_key.created'?: { + /** + * The tracking ID of the API key. + */ + id?: string; /** * The payload used to create the API key. */ @@ -398,24 +424,15 @@ export type AuditLog = { */ scopes?: Array; }; - /** - * The tracking ID of the API key. - */ - id?: string; }; /** * The details for events with this `type`. */ - 'api_key.deleted'?: { + 'api_key.updated'?: { /** * The tracking ID of the API key. */ id?: string; - }; - /** - * The details for events with this `type`. - */ - 'api_key.updated'?: { /** * The payload used to update the API key. */ @@ -425,123 +442,69 @@ export type AuditLog = { */ scopes?: Array; }; + }; + /** + * The details for events with this `type`. + */ + 'api_key.deleted'?: { /** * The tracking ID of the API key. */ id?: string; }; /** - * The details for events with this `type`. + * The project and fine-tuned model checkpoint that the checkpoint permission was created for. */ - 'certificate.created'?: { + 'checkpoint_permission.created'?: { /** - * The certificate ID. + * The ID of the checkpoint permission. */ id?: string; /** - * The name of the certificate. + * The payload used to create the checkpoint permission. */ - name?: 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`. */ - 'certificate.deleted'?: { - /** - * The certificate content in PEM format. - */ - certificate?: string; + 'checkpoint_permission.deleted'?: { /** - * The certificate ID. + * The ID of the checkpoint permission. */ id?: string; - /** - * The name of the certificate. - */ - name?: string; }; /** * The details for events with this `type`. */ - 'certificate.updated'?: { + 'invite.sent'?: { /** - * The certificate ID. + * The ID of the invite. */ id?: string; /** - * The name of the certificate. + * The payload used to create the invite. */ - name?: string; - }; - /** - * The details for events with this `type`. - */ - 'certificates.activated'?: { - certificates?: Array<{ + data?: { /** - * 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 project and fine-tuned model checkpoint that the checkpoint permission was created for. - */ - 'checkpoint_permission.created'?: { - /** - * The payload used to create the checkpoint permission. - */ - data?: { - /** - * The ID of the fine-tuned model checkpoint. + * The email invited to the organization. */ - fine_tuned_model_checkpoint?: string; + email?: string; /** - * The ID of the project that the checkpoint permission was created for. + * The role the email was invited to be. Is either `owner` or `member`. */ - project_id?: string; + role?: string; }; - /** - * The ID of the checkpoint permission. - */ - id?: string; - }; - /** - * The details for events with this `type`. - */ - 'checkpoint_permission.deleted'?: { - /** - * The ID of the checkpoint permission. - */ - id?: string; }; - /** - * The Unix timestamp (in seconds) of the event. - */ - effective_at: number; - /** - * The ID of this log. - */ - id: string; /** * The details for events with this `type`. */ @@ -560,28 +523,6 @@ export type AuditLog = { */ id?: string; }; - /** - * The details for events with this `type`. - */ - 'invite.sent'?: { - /** - * 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; - }; - /** - * The ID of the invite. - */ - id?: string; - }; /** * The details for events with this `type`. */ @@ -612,18 +553,18 @@ export type AuditLog = { * The details for events with this `type`. */ 'organization.updated'?: { + /** + * The organization ID. + */ + id?: string; /** * The payload used to update the organization settings. */ changes_requested?: { /** - * 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` + * The organization title. */ - api_call_logging_project_ids?: string; + title?: string; /** * The organization description. */ @@ -636,46 +577,28 @@ export type AuditLog = { * 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; - /** - * The organization title. - */ - title?: 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 organization ID. - */ - 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. - */ - project?: { - /** - * The project ID. - */ - id?: string; - /** - * The project title. - */ - name?: string; }; /** * The details for events with this `type`. */ - 'project.archived'?: { + 'project.created'?: { /** * The project ID. */ id?: string; - }; - /** - * The details for events with this `type`. - */ - 'project.created'?: { /** * The payload used to create the project. */ @@ -689,15 +612,15 @@ export type AuditLog = { */ title?: string; }; - /** - * The project ID. - */ - id?: string; }; /** * The details for events with this `type`. */ 'project.updated'?: { + /** + * The project ID. + */ + id?: string; /** * The payload used to update the project. */ @@ -707,11 +630,54 @@ export type AuditLog = { */ title?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'project.archived'?: { /** * The project ID. */ id?: string; }; + /** + * The details for events with this `type`. + */ + '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; + }; + }; /** * The details for events with this `type`. */ @@ -724,17 +690,17 @@ export type AuditLog = { /** * The details for events with this `type`. */ - 'user.added'?: { + 'service_account.created'?: { /** - * The user ID. + * The service account ID. */ id?: string; /** - * The payload used to add the user to the project. + * The payload used to create the service account. */ data?: { /** - * The role of the user. Is either `owner` or `member`. + * The role of the service account. Is either `owner` or `member`. */ role?: string; }; @@ -742,17 +708,17 @@ export type AuditLog = { /** * The details for events with this `type`. */ - 'user.updated'?: { + 'service_account.updated'?: { /** - * The project ID. + * The service account ID. */ id?: string; /** - * The payload used to update the user. + * The payload used to updated the service account. */ changes_requested?: { /** - * The role of the user. Is either `owner` or `member`. + * The role of the service account. Is either `owner` or `member`. */ role?: string; }; @@ -769,86 +735,120 @@ export type AuditLog = { /** * The details for events with this `type`. */ - 'service_account.updated'?: { + 'user.added'?: { /** - * The payload used to updated the service account. + * The user ID. */ - changes_requested?: { + id?: string; + /** + * The payload used to add the user to the project. + */ + data?: { /** - * The role of the service account. Is either `owner` or `member`. + * The role of the user. Is either `owner` or `member`. */ role?: string; }; - /** - * The service account ID. - */ - id?: string; }; /** * The details for events with this `type`. */ - 'rate_limit.updated'?: { + 'user.updated'?: { /** - * The payload used to update the rate limits. + * The project ID. + */ + id?: string; + /** + * The payload used to update the user. */ 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. + * The role of the user. Is either `owner` or `member`. */ - batch_1_day_max_input_tokens?: number; + role?: string; }; + }; + /** + * The details for events with this `type`. + */ + 'user.deleted'?: { /** - * The rate limit ID + * The user ID. */ id?: string; }; - type: AuditLogEventType; /** * The details for events with this `type`. */ - 'service_account.created'?: { + 'certificate.created'?: { /** - * The payload used to create the service account. + * The certificate ID. */ - data?: { - /** - * The role of the service account. Is either `owner` or `member`. - */ - role?: string; - }; + id?: string; /** - * The service account ID. + * 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`. */ - 'user.deleted'?: { + 'certificate.deleted'?: { /** - * The user ID. + * 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; + }>; }; }; @@ -856,12 +856,12 @@ export type AuditLog = { * The actor who performed the audit logged action. */ export type AuditLogActor = { - api_key?: AuditLogActorApiKey; - session?: AuditLogActorSession; /** * The type of actor. Is either `session` or `api_key`. */ type?: 'session' | 'api_key'; + session?: AuditLogActorSession; + api_key?: AuditLogActorApiKey; }; /** @@ -872,12 +872,12 @@ export type AuditLogActorApiKey = { * The tracking id of the API key. */ id?: string; - service_account?: AuditLogActorServiceAccount; /** * The type of API key. Can be either `user` or `service_account`. */ type?: 'user' | 'service_account'; user?: AuditLogActorUser; + service_account?: AuditLogActorServiceAccount; }; /** @@ -894,25 +894,25 @@ export type AuditLogActorServiceAccount = { * 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 user who performed the audit logged action. */ export type AuditLogActorUser = { - /** - * The user email. - */ - email?: string; /** * The user id. */ id?: string; + /** + * The user email. + */ + email?: string; }; /** @@ -920,29 +920,29 @@ export type AuditLogActorUser = { */ export const AuditLogEventType = { API_KEY_CREATED: 'api_key.created', - API_KEY_DELETED: 'api_key.deleted', 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', - INVITE_SENT: 'invite.sent', - LOGIN_FAILED: 'login.failed', LOGIN_SUCCEEDED: 'login.succeeded', - LOGOUT_FAILED: 'logout.failed', + LOGIN_FAILED: 'login.failed', LOGOUT_SUCCEEDED: 'logout.succeeded', + LOGOUT_FAILED: 'logout.failed', ORGANIZATION_UPDATED: 'organization.updated', - PROJECT_ARCHIVED: 'project.archived', PROJECT_CREATED: 'project.created', PROJECT_UPDATED: 'project.updated', - RATE_LIMIT_DELETED: 'rate_limit.deleted', - RATE_LIMIT_UPDATED: 'rate_limit.updated', + PROJECT_ARCHIVED: 'project.archived', SERVICE_ACCOUNT_CREATED: 'service_account.created', - SERVICE_ACCOUNT_DELETED: 'service_account.deleted', 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_DELETED: 'user.deleted', USER_UPDATED: 'user.updated', + USER_DELETED: 'user.deleted', } as const; /** @@ -963,88 +963,88 @@ export type AutoChunkingStrategyRequestParam = { }; export type Batch = { + id: string; /** - * The Unix timestamp (in seconds) for when the batch was cancelled. + * The object type, which is always `batch`. */ - cancelled_at?: number; + object: 'batch'; /** - * The Unix timestamp (in seconds) for when the batch started cancelling. + * The OpenAI API endpoint used by the batch. */ - cancelling_at?: number; + endpoint: string; + errors?: { + /** + * The object type, which is always `list`. + */ + object?: string; + data?: Array; + }; /** - * The Unix timestamp (in seconds) for when the batch was completed. + * The ID of the input file for the batch. */ - completed_at?: number; + input_file_id: string; /** * The time frame within which the batch should be processed. */ completion_window: string; /** - * The Unix timestamp (in seconds) for when the batch was created. + * The current status of the batch. */ - created_at: number; + status: + | 'validating' + | 'failed' + | 'in_progress' + | 'finalizing' + | 'completed' + | 'expired' + | 'cancelling' + | 'cancelled'; /** - * The OpenAI API endpoint used by the batch. + * The ID of the file containing the outputs of successfully executed requests. */ - endpoint: string; + output_file_id?: string; /** * The ID of the file containing the outputs of requests with errors. */ error_file_id?: string; - errors?: { - data?: Array; - /** - * The object type, which is always `list`. - */ - object?: string; - }; /** - * The Unix timestamp (in seconds) for when the batch expired. + * The Unix timestamp (in seconds) for when the batch was created. */ - expired_at?: number; + created_at: number; /** - * The Unix timestamp (in seconds) for when the batch will expire. + * The Unix timestamp (in seconds) for when the batch started processing. */ - expires_at?: number; + in_progress_at?: number; /** - * The Unix timestamp (in seconds) for when the batch failed. + * The Unix timestamp (in seconds) for when the batch will expire. */ - failed_at?: number; + expires_at?: number; /** * The Unix timestamp (in seconds) for when the batch started finalizing. */ finalizing_at?: number; - id: string; /** - * The Unix timestamp (in seconds) for when the batch started processing. + * The Unix timestamp (in seconds) for when the batch was completed. */ - in_progress_at?: number; + completed_at?: number; /** - * The ID of the input file for the batch. + * The Unix timestamp (in seconds) for when the batch failed. */ - input_file_id: string; - metadata?: Metadata; + failed_at?: number; /** - * The object type, which is always `batch`. + * The Unix timestamp (in seconds) for when the batch expired. */ - object: 'batch'; + expired_at?: number; /** - * The ID of the file containing the outputs of successfully executed requests. + * The Unix timestamp (in seconds) for when the batch started cancelling. */ - output_file_id?: string; - request_counts?: BatchRequestCounts; + cancelling_at?: number; /** - * The current status of the batch. + * The Unix timestamp (in seconds) for when the batch was cancelled. */ - status: - | 'validating' - | 'failed' - | 'in_progress' - | 'finalizing' - | 'completed' - | 'expired' - | 'cancelling' - | 'cancelled'; + cancelled_at?: number; + request_counts?: BatchRequestCounts; + metadata?: Metadata; }; /** @@ -1085,39 +1085,39 @@ export type BatchRequestInput = { * The per-line object of the batch output and error files */ export type BatchRequestOutput = { + id?: string; /** * A developer-provided per-request id that will be used to match outputs to inputs. */ custom_id?: string; - /** - * For requests that failed with a non-HTTP error, this will contain more information on the cause of the failure. - */ - error?: { + response?: { /** - * A machine-readable error code. + * The HTTP status code of the response */ - code?: string; + status_code?: number; /** - * A human-readable error message. + * An unique identifier for the OpenAI API request. Please include this request ID when contacting support. */ - message?: string; - }; - id?: string; - response?: { + 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?: { /** - * An unique identifier for the OpenAI API request. Please include this request ID when contacting support. + * A machine-readable error code. */ - request_id?: string; + code?: string; /** - * The HTTP status code of the response + * A human-readable error message. */ - status_code?: number; + message?: string; }; }; @@ -1126,44 +1126,44 @@ export type BatchRequestOutput = { */ export type Certificate = { /** - * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific 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`. + * */ - active?: boolean; + 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 content of the certificate in PEM format. + * The Unix timestamp (in seconds) of when the certificate becomes valid. */ - content?: string; + valid_at?: number; /** * The Unix timestamp (in seconds) of when the certificate expires. */ expires_at?: number; /** - * The Unix timestamp (in seconds) of when the certificate becomes valid. + * The content of the certificate in PEM format. */ - valid_at?: number; + content?: string; }; /** - * The Unix timestamp (in seconds) of when the certificate was uploaded. - */ - created_at: number; - /** - * The identifier, which can be referenced in API endpoints + * Whether the certificate is currently active at the specified scope. Not returned when getting details for a specific certificate. */ - id: string; - /** - * The name of the certificate. - */ - name: string; - /** - * 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'; + active?: boolean; }; /** @@ -1207,26 +1207,26 @@ export type ChatCompletionAllowedTools = { * */ export type ChatCompletionAllowedToolsChoice = { - allowed_tools: ChatCompletionAllowedTools; /** * Allowed tool configuration type. Always `allowed_tools`. */ type: 'allowed_tools'; + allowed_tools: ChatCompletionAllowedTools; }; export type ChatCompletionDeleted = { /** - * Whether the chat completion was deleted. + * The type of object being deleted. */ - deleted: boolean; + object: 'chat.completion.deleted'; /** * The ID of the chat completion that was deleted. */ id: string; /** - * The type of object being deleted. + * Whether the chat completion was deleted. */ - object: 'chat.completion.deleted'; + deleted: boolean; }; /** @@ -1262,6 +1262,11 @@ 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. * @@ -1271,19 +1276,14 @@ export type ChatCompletionList = { * The identifier of the first chat completion in the data array. */ first_id: string; - /** - * Indicates whether there are more Chat Completions available. - */ - has_more: boolean; /** * The identifier of the last chat completion in the data array. */ last_id: string; /** - * The type of this object. It is always set to "list". - * + * Indicates whether there are more Chat Completions available. */ - object: 'list'; + has_more: boolean; }; /** @@ -1293,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 input for the custom tool call generated by the model. - */ - input: string; /** * The name of the custom tool to call. */ name: string; + /** + * The input for the custom tool call generated by the model. + */ + input: string; }; - /** - * The ID of the tool call. - */ - id: string; - /** - * The type of the tool. Always `custom`. - */ - type: 'custom'; }; /** @@ -1323,12 +1323,21 @@ 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< 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. @@ -1337,29 +1346,20 @@ export type ChatCompletionMessageList = { content_parts?: Array< ChatCompletionRequestMessageContentPartText | ChatCompletionRequestMessageContentPartImage >; - /** - * The identifier of the chat message. - */ - id: string; } >; /** * The identifier of the first chat message in the data array. */ first_id: string; - /** - * Indicates whether there are more chat messages available. - */ - has_more: boolean; /** * The identifier of the last chat message in the data array. */ last_id: string; /** - * The type of this object. It is always set to "list". - * + * Indicates whether there are more chat messages available. */ - object: 'list'; + has_more: boolean; }; /** @@ -1369,19 +1369,6 @@ export type ChatCompletionMessageList = { * */ export type ChatCompletionMessageToolCall = { - /** - * The function that the model called. - */ - function: { - /** - * 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; - }; /** * The ID of the tool call. */ @@ -1390,28 +1377,41 @@ export type ChatCompletionMessageToolCall = { * The type of the tool. Currently, only `function` is supported. */ type: 'function'; -}; - -export type ChatCompletionMessageToolCallChunk = { - function?: { + /** + * The function that the model called. + */ + function: { /** - * 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. + * The name of the function to call. */ - arguments?: string; + name: string; /** - * The name of the function to 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. */ - name?: string; + arguments: string; }; +}; + +export type ChatCompletionMessageToolCallChunk = { + index: number; /** * The ID of the tool call. */ id?: string; - index: number; /** * The type of the tool. Currently, only `function` is supported. */ 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; + }; }; /** @@ -1447,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: { /** * The name of the function to call. */ name: string; }; - /** - * For function calling, the type is always `function`. - */ - type: 'function'; }; /** @@ -1465,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: { /** * The name of the custom tool to call. */ name: string; }; - /** - * For custom tool calling, the type is always `custom`. - */ - type: 'custom'; }; /** @@ -1484,6 +1484,23 @@ export type ChatCompletionNamedToolChoiceCustom = { * */ export type ChatCompletionRequestAssistantMessage = { + /** + * 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). @@ -1496,11 +1513,7 @@ export type ChatCompletionRequestAssistantMessage = { */ id: string; }; - /** - * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified. - * - */ - content?: string | Array; + 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. * @@ -1516,19 +1529,6 @@ export type ChatCompletionRequestAssistantMessage = { */ name: string; }; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; - /** - * The refusal message by the assistant. - */ - refusal?: string; - /** - * The role of the messages author, in this case `assistant`. - */ - role: 'assistant'; - tool_calls?: ChatCompletionMessageToolCalls; }; export type ChatCompletionRequestAssistantMessageContentPart = @@ -1552,14 +1552,14 @@ export type ChatCompletionRequestDeveloperMessage = { * The contents of the developer message. */ content: string | Array; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; /** * 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; }; /** @@ -1568,6 +1568,10 @@ 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. */ @@ -1576,10 +1580,6 @@ export type ChatCompletionRequestFunctionMessage = { * The name of the function to call. */ name: string; - /** - * The role of the messages author, in this case `function`. - */ - role: 'function'; }; export type ChatCompletionRequestMessage = @@ -1609,6 +1609,10 @@ export type ChatCompletionRequestMessage = * */ export type ChatCompletionRequestMessageContentPartAudio = { + /** + * The type of the content part. Always `input_audio`. + */ + type: 'input_audio'; input_audio: { /** * Base64 encoded audio data. @@ -1620,10 +1624,6 @@ export type ChatCompletionRequestMessageContentPartAudio = { */ format: 'wav' | 'mp3'; }; - /** - * The type of the content part. Always `input_audio`. - */ - type: 'input_audio'; }; /** @@ -1633,7 +1633,17 @@ export type ChatCompletionRequestMessageContentPartAudio = { * */ export type ChatCompletionRequestMessageContentPartFile = { + /** + * The type of the content part. Always `file`. + */ + 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. @@ -1645,17 +1655,7 @@ export type ChatCompletionRequestMessageContentPartFile = { * */ file_id?: string; - /** - * The name of the file, used when passing the file to the model as a - * string. - * - */ - filename?: string; }; - /** - * The type of the content part. Always `file`. - */ - type: 'file'; }; /** @@ -1665,34 +1665,34 @@ export type ChatCompletionRequestMessageContentPartFile = { * */ export type ChatCompletionRequestMessageContentPartImage = { + /** + * The type of the content part. + */ + type: 'image_url'; image_url: { - /** - * 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'; /** * 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'; }; - /** - * The type of the content part. - */ - type: 'image_url'; }; /** * Refusal content part */ export type ChatCompletionRequestMessageContentPartRefusal = { - /** - * 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; }; /** @@ -1702,14 +1702,14 @@ export type ChatCompletionRequestMessageContentPartRefusal = { * */ export type ChatCompletionRequestMessageContentPartText = { - /** - * The text content. - */ - text: string; /** * The type of the content part. */ type: 'text'; + /** + * The text content. + */ + text: string; }; /** @@ -1726,13 +1726,13 @@ export type ChatCompletionRequestSystemMessage = { */ content: string | Array; /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. + * The role of the messages author, in this case `system`. */ - name?: string; + role: 'system'; /** - * The role of the messages author, in this case `system`. + * An optional name for the participant. Provides the model information to differentiate between participants of the same role. */ - role: 'system'; + name?: string; }; export type ChatCompletionRequestSystemMessageContentPart = @@ -1742,14 +1742,14 @@ export type ChatCompletionRequestSystemMessageContentPart = * Tool message */ export type ChatCompletionRequestToolMessage = { - /** - * The contents of the tool message. - */ - content: string | Array; /** * 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. */ @@ -1772,14 +1772,14 @@ export type ChatCompletionRequestUserMessage = { * */ content: string | Array; - /** - * An optional name for the participant. Provides the model information to differentiate between participants of the same role. - */ - name?: string; /** * 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 = @@ -1800,6 +1800,15 @@ export type ChatCompletionRequestUserMessageContentPart = * 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). @@ -1822,16 +1831,35 @@ export type ChatCompletionResponseMessage = { * The index of the first character of the URL citation in the message. */ start_index: number; - /** - * The title of the web resource. - */ - title: string; /** * 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. + */ + arguments: string; + /** + * The name of the function to call. + */ + 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). @@ -1839,11 +1867,9 @@ export type ChatCompletionResponseMessage = { */ audio?: { /** - * Base64 encoded audio bytes generated by the model, in the format - * specified in the request. - * + * Unique identifier for this audio response. */ - data: string; + 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 @@ -1852,54 +1878,28 @@ export type ChatCompletionResponseMessage = { */ expires_at: number; /** - * Unique identifier for this audio response. + * Base64 encoded audio bytes generated by the model, in the format + * specified in the request. + * */ - id: string; + data: string; /** * Transcript of the audio generated by the model. */ transcript: string; }; - /** - * The contents of the 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; - }; - /** - * The refusal message generated by the model. - */ - refusal: string; - /** - * The role of the author of this message. - */ - role: 'assistant'; - tool_calls?: ChatCompletionMessageToolCalls; }; /** * The role of the author of a message */ export const ChatCompletionRole = { - ASSISTANT: 'assistant', DEVELOPER: 'developer', - FUNCTION: 'function', SYSTEM: 'system', - TOOL: 'tool', USER: 'user', + ASSISTANT: 'assistant', + TOOL: 'tool', + FUNCTION: 'function', } as const; /** @@ -1912,17 +1912,6 @@ export type ChatCompletionRole = (typeof ChatCompletionRole)[keyof typeof ChatCo * */ export type ChatCompletionStreamOptions = { - /** - * 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 @@ -1935,6 +1924,17 @@ export type ChatCompletionStreamOptions = { * */ 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; }; /** @@ -1960,46 +1960,46 @@ export type ChatCompletionStreamResponseDelta = { */ name?: string; }; - /** - * The refusal message generated by the model. - */ - refusal?: string; + tool_calls?: Array; /** * The role of the author of this message. */ role?: 'developer' | 'system' | 'user' | 'assistant' | 'tool'; - tool_calls?: Array; + /** + * The refusal message generated by the model. + */ + refusal?: string; }; 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. + * The token. */ - bytes: Array; + 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; /** - * The token. + * 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. */ - token: string; + 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<{ /** - * 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. + * The token. */ - bytes: Array; + 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; /** - * The token. + * 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. */ - token: string; + bytes: Array; }>; }; @@ -2010,11 +2010,11 @@ export type ChatCompletionTokenLogprob = { * */ export type ChatCompletionTool = { - function: FunctionObject; /** * The type of the tool. Currently, only `function` is supported. */ type: 'function'; + function: FunctionObject; }; /** @@ -2053,17 +2053,17 @@ export type ChunkingStrategyRequestParam = * */ export 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'; /** * 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. * @@ -2083,23 +2083,23 @@ export type Click = { * */ export type CodeInterpreterFileOutput = { + /** + * The type of the code interpreter file output. Always `files`. + * + */ + type: 'files'; files: Array<{ /** - * The ID of the file. + * The MIME type of the file. * */ - file_id: string; + mime_type: string; /** - * The MIME type of the file. + * The ID of the file. * */ - mime_type: string; + file_id: string; }>; - /** - * The type of the code interpreter file output. Always `files`. - * - */ - type: 'files'; }; /** @@ -2126,14 +2126,14 @@ export type CodeInterpreterOutputImage = { * */ export type CodeInterpreterOutputLogs = { - /** - * 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; }; /** @@ -2144,15 +2144,15 @@ export type CodeInterpreterOutputLogs = { */ export type CodeInterpreterTextOutput = { /** - * The logs of the code interpreter tool call. + * The type of the code interpreter text output. Always `logs`. * */ - logs: string; + type: 'logs'; /** - * The type of the code interpreter text output. Always `logs`. + * The logs of the code interpreter tool call. * */ - type: 'logs'; + logs: string; }; /** @@ -2163,16 +2163,16 @@ export type CodeInterpreterTextOutput = { */ export type CodeInterpreterTool = { /** - * The code interpreter container. Can be a container ID or an object that - * specifies uploaded file IDs to make available to your code. + * The type of the code interpreter tool. Always `code_interpreter`. * */ - container: string | CodeInterpreterToolAuto; + type: 'code_interpreter'; /** - * The type of the code interpreter tool. Always `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. * */ - type: 'code_interpreter'; + container: string | CodeInterpreterToolAuto; }; /** @@ -2183,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'; }; /** @@ -2202,20 +2202,30 @@ export type CodeInterpreterToolAuto = { */ export type CodeInterpreterToolCall = { /** - * The code to run, or null if not available. + * The type of the code interpreter tool call. Always `code_interpreter_call`. * */ - code: string; + 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 unique ID of the code interpreter tool call. + * The code to run, or null if not available. * */ - id: string; + code: string; /** * The outputs generated by the code interpreter, such as logs or images. * Can be null if no outputs are available. @@ -2229,16 +2239,6 @@ export type CodeInterpreterToolCall = { type?: 'CodeInterpreterOutputImage'; } & CodeInterpreterOutputImage) >; - /** - * 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 type of the code interpreter tool call. Always `code_interpreter_call`. - * - */ - type: 'code_interpreter_call'; }; /** @@ -2248,10 +2248,6 @@ export type CodeInterpreterToolCall = { * */ export type ComparisonFilter = { - /** - * The key to compare against the value. - */ - key: string; /** * Specifies the comparison operator: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`. * - `eq`: equals @@ -2263,6 +2259,10 @@ export type ComparisonFilter = { * */ 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. */ @@ -2271,15 +2271,15 @@ export type ComparisonFilter = { export type CompleteUploadRequest = { /** - * The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect. + * The ordered list of Part IDs. * */ - md5?: string; + part_ids: Array; /** - * The ordered list of Part IDs. + * The optional md5 checksum for the file contents to verify if the bytes uploaded matches what you expect. * */ - part_ids: Array; + md5?: string; }; /** @@ -2290,6 +2290,14 @@ 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. */ @@ -2318,10 +2326,6 @@ export type CompletionUsage = { */ rejected_prediction_tokens?: number; }; - /** - * Number of tokens in the prompt. - */ - prompt_tokens: number; /** * Breakdown of tokens used in the prompt. */ @@ -2335,10 +2339,6 @@ export type CompletionUsage = { */ cached_tokens?: number; }; - /** - * Total number of tokens used in the request (prompt + completion). - */ - total_tokens: number; }; /** @@ -2347,14 +2347,14 @@ export type CompletionUsage = { * Combine multiple filters using `and` or `or`. */ export type CompoundFilter = { - /** - * Array of filters to combine. Items can be `ComparisonFilter` or `CompoundFilter`. - */ - filters: Array; /** * 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 = @@ -2392,19 +2392,19 @@ export type ComputerAction = */ export type ComputerScreenshotImage = { /** - * The identifier of an uploaded file that contains the screenshot. + * Specifies the event type. For a computer screenshot, this property is + * always set to `computer_screenshot`. + * */ - file_id?: string; + type: 'computer_screenshot'; /** * The URL of the screenshot image. */ image_url?: string; /** - * Specifies the event type. For a computer screenshot, this property is - * always set to `computer_screenshot`. - * + * The identifier of an uploaded file that contains the screenshot. */ - type: 'computer_screenshot'; + file_id?: string; }; /** @@ -2415,16 +2415,20 @@ export type ComputerScreenshotImage = { * */ export type ComputerToolCall = { - action: ComputerAction; /** - * An identifier used when responding to the tool call with output. - * + * The type of the computer call. Always `computer_call`. */ - call_id: string; + 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. * @@ -2436,10 +2440,6 @@ export type ComputerToolCall = { * */ status: 'in_progress' | 'completed' | 'incomplete'; - /** - * The type of the computer call. Always `computer_call`. - */ - type: 'computer_call'; }; /** @@ -2450,21 +2450,26 @@ export type ComputerToolCall = { */ export type ComputerToolCallOutput = { /** - * The safety checks reported by the API that have been acknowledged by the - * developer. + * The type of the computer tool call output. Always `computer_call_output`. * */ - acknowledged_safety_checks?: Array; + 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 ID of the computer tool call output. + * The safety checks reported by the API that have been acknowledged by the + * developer. * */ - id?: string; + acknowledged_safety_checks?: Array; output: ComputerScreenshotImage; /** * The status of the message input. One of `in_progress`, `completed`, or @@ -2472,11 +2477,6 @@ export type ComputerToolCallOutput = { * */ status?: 'in_progress' | 'completed' | 'incomplete'; - /** - * The type of the computer tool call output. Always `computer_call_output`. - * - */ - type: 'computer_call_output'; }; export type ComputerToolCallOutputResource = ComputerToolCallOutput & { @@ -2492,14 +2492,14 @@ export type ComputerToolCallOutputResource = ComputerToolCallOutput & { * */ export type ComputerToolCallSafetyCheck = { - /** - * The type of the pending safety check. - */ - code: 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. */ @@ -2507,6 +2507,10 @@ export type ComputerToolCallSafetyCheck = { }; export type ContainerFileListResource = { + /** + * The type of object returned, must be 'list'. + */ + object: 'list'; /** * A list of container files. */ @@ -2515,18 +2519,14 @@ export type ContainerFileListResource = { * The ID of the first file in the list. */ first_id: string; - /** - * Whether there are more files available. - */ - has_more: boolean; /** * The ID of the last file in the list. */ last_id: string; /** - * The type of object returned, must be 'list'. + * Whether there are more files available. */ - object: 'list'; + has_more: boolean; }; /** @@ -2534,9 +2534,13 @@ export type ContainerFileListResource = { */ export type ContainerFileResource = { /** - * Size of the file in bytes. + * Unique identifier for the file. */ - bytes: number; + id: string; + /** + * The type of this object (`container.file`). + */ + object: 'container.file'; /** * The container this file belongs to. */ @@ -2546,13 +2550,9 @@ export type ContainerFileResource = { */ created_at: number; /** - * Unique identifier for the file. - */ - id: string; - /** - * The type of this object (`container.file`). + * Size of the file in bytes. */ - object: 'container.file'; + bytes: number; /** * Path of the file in the container. */ @@ -2564,6 +2564,10 @@ export type ContainerFileResource = { }; export type ContainerListResource = { + /** + * The type of object returned, must be 'list'. + */ + object: 'list'; /** * A list of containers. */ @@ -2572,28 +2576,40 @@ export type ContainerListResource = { * The ID of the first container in the list. */ first_id: string; - /** - * Whether there are more containers available. - */ - has_more: boolean; /** * The ID of the last container in the list. */ last_id: string; /** - * The type of object returned, must be 'list'. + * Whether there are more containers available. */ - object: 'list'; + 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. @@ -2610,22 +2626,6 @@ export type ContainerResource = { */ minutes?: number; }; - /** - * Unique identifier for the container. - */ - id: string; - /** - * Name of the container. - */ - name: string; - /** - * The type of this object. - */ - object: string; - /** - * Status of the container (e.g., active, deleted). - */ - status: string; }; /** @@ -2657,24 +2657,24 @@ export type Coordinate = { * The aggregated costs details of the specific time bucket. */ export type CostsResult = { + object: 'organization.costs.result'; /** * The monetary value in its associated currency. */ amount?: { - /** - * Lowercase ISO-4217 currency e.g. "usd" - */ - currency?: string; /** * The numeric value of the cost. */ value?: number; + /** + * Lowercase ISO-4217 currency e.g. "usd" + */ + currency?: string; }; /** * When `group_by=line_item`, this field provides the line item of the grouped costs result. */ line_item?: string; - object: 'organization.costs.result'; /** * When `group_by=project_id`, this field provides the project ID of the grouped costs result. */ @@ -2683,33 +2683,31 @@ export type CostsResult = { export type CreateAssistantRequest = { /** - * The description of the assistant. The maximum length is 512 characters. + * 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. * */ - description?: string; + model: string | AssistantSupportedModels; /** - * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * The name of the assistant. The maximum length is 256 characters. * */ - instructions?: string; - metadata?: Metadata; + name?: 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. + * The description of the assistant. The maximum length is 512 characters. * */ - model: string | AssistantSupportedModels; + description?: string; /** - * The name of the assistant. The maximum length is 256 characters. + * The system instructions that the assistant uses. The maximum length is 256,000 characters. * */ - name?: string; + instructions?: string; reasoning_effort?: ReasoningEffort; - response_format?: AssistantsApiResponseFormatOption; /** - * 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. + * 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`. * */ - temperature?: number; + 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. * @@ -2733,6 +2731,11 @@ export type CreateAssistantRequest = { * */ 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. */ @@ -2744,7 +2747,15 @@ export type CreateAssistantRequest = { 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`. * @@ -2752,30 +2763,18 @@ export type CreateAssistantRequest = { * */ 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; }; - /** - * Always `static`. - */ - type: 'static'; }; - /** - * 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; metadata?: Metadata; }>; }; }; + metadata?: Metadata; /** - * 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`. + * 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. * */ - tools?: Array; + 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. * @@ -2783,65 +2782,129 @@ export type CreateAssistantRequest = { * */ top_p?: number; + response_format?: AssistantsApiResponseFormatOption; }; export type CreateChatCompletionRequest = CreateModelResponseProperties & { /** - * 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 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). * */ - audio?: { - /** - * Specifies the output audio format. Must be one of `wav`, `mp3`, `flac`, - * `opus`, or `pcm16`. - * - */ - format: 'wav' | 'aac' | 'mp3' | 'flac' | 'opus' | 'pcm16'; - /** - * The voice the model uses to respond. Supported voices are - * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. - * - */ - voice: VoiceIdsShared; - }; + messages: Array; /** - * 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. + * 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. * */ - frequency_penalty?: number; + model: ModelIdsShared; + modalities?: ResponseModalities; + verbosity?: Verbosity; + reasoning_effort?: ReasoningEffort; /** - * Deprecated in favor of `tool_choice`. + * 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). * - * Controls which (if any) function is called by the model. + */ + 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. * - * `none` means the model will not call a function and instead generates a - * message. + */ + 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. * - * `auto` means the model can pick between generating a message or calling a - * function. + */ + presence_penalty?: number; + /** + * Web search * - * Specifying a particular function via `{"name": "my_function"}` forces the - * model to call that function. + * 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). * - * `none` is the default when no functions are present. `auto` is the default - * if functions are present. + */ + 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. * - * @deprecated */ - function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption; + response_format?: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject; /** - * Deprecated in favor of `tools`. + * 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 functions the model may generate JSON inputs for. + */ + audio?: { + /** + * The voice the model uses to respond. Supported voices are + * `alloy`, `ash`, `ballad`, `coral`, `echo`, `fable`, `nova`, `onyx`, `sage`, and `shimmer`. + * + */ + voice: VoiceIdsShared; + /** + * 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. * - * @deprecated */ - functions?: Array; + 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. * @@ -2863,11 +2926,6 @@ export type CreateChatCompletionRequest = CreateModelResponseProperties & { * */ logprobs?: boolean; - /** - * 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; /** * The maximum number of [tokens](/tokenizer) that can be generated in the * chat completion. This value can be used to control @@ -2880,28 +2938,10 @@ export type CreateChatCompletionRequest = CreateModelResponseProperties & { * @deprecated */ max_tokens?: number; - /** - * 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; - modalities?: ResponseModalities; - /** - * 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; /** * 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; - parallel_tool_calls?: ParallelToolCalls; /** * 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 @@ -2912,28 +2952,6 @@ export type CreateChatCompletionRequest = CreateModelResponseProperties & { prediction?: { type?: 'PredictionContent'; } & PredictionContent; - /** - * 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; - reasoning_effort?: ReasoningEffort; - /** - * 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; /** * 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. @@ -2943,27 +2961,7 @@ export type CreateChatCompletionRequest = CreateModelResponseProperties & { * @deprecated */ seed?: number; - stop?: StopConfiguration; - /** - * 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; stream_options?: ChatCompletionStreamOptions; - tool_choice?: ChatCompletionToolChoiceOption; /** * 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 @@ -2978,42 +2976,48 @@ export type CreateChatCompletionRequest = CreateModelResponseProperties & { type?: 'CustomToolChatCompletions'; } & CustomToolChatCompletions) >; + tool_choice?: ChatCompletionToolChoiceOption; + parallel_tool_calls?: ParallelToolCalls; /** - * 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. + * 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 */ - top_logprobs?: number; - verbosity?: Verbosity; + function_call?: 'none' | 'auto' | ChatCompletionFunctionCallOption; /** - * Web search + * Deprecated in favor of `tools`. * - * 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). + * A list of functions the model may generate JSON inputs for. * + * + * @deprecated */ - web_search_options?: { - search_context_size?: WebSearchContextSize; - /** - * Approximate location parameters for the search. - * - */ - user_location?: { - approximate: WebSearchLocation; - /** - * The type of location approximation. Always `approximate`. - * - */ - type: 'approximate'; - }; - }; + 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. */ @@ -3030,6 +3034,7 @@ export type CreateChatCompletionResponse = { * The index of the choice in the list of choices. */ index: number; + message: ChatCompletionResponseMessage; /** * Log probability information for the choice. */ @@ -3043,24 +3048,15 @@ export type CreateChatCompletionResponse = { */ refusal: Array; }; - message: ChatCompletionResponseMessage; }>; /** * The Unix timestamp (in seconds) of when the chat completion was created. */ created: number; - /** - * A unique identifier for the chat completion. - */ - id: string; /** * The model used for the chat completion. */ model: string; - /** - * The object type, which is always `chat.completion`. - */ - object: 'chat.completion'; service_tier?: ServiceTier; /** * This fingerprint represents the backend configuration that the model runs with. @@ -3071,6 +3067,10 @@ export type CreateChatCompletionResponse = { * @deprecated */ system_fingerprint?: string; + /** + * The object type, which is always `chat.completion`. + */ + object: 'chat.completion'; usage?: CompletionUsage; }; @@ -3081,6 +3081,10 @@ export type CreateChatCompletionResponse = { * */ 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}`. @@ -3088,18 +3092,6 @@ export type CreateChatCompletionStreamResponse = { */ choices: Array<{ delta: ChatCompletionStreamResponseDelta; - /** - * 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; /** * Log probability information for the choice. */ @@ -3113,23 +3105,27 @@ export type CreateChatCompletionStreamResponse = { */ refusal: Array; }; - }>; - /** - * The Unix timestamp (in seconds) of when the chat completion was created. Each chunk has the same timestamp. - */ - created: number; - /** - * A unique identifier for the chat completion. Each chunk has the same ID. - */ - id: string; - /** - * The model to generate the completion. + /** + * 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. */ - model: string; + created: number; /** - * The object type, which is always `chat.completion.chunk`. + * The model to generate the completion. */ - object: 'chat.completion.chunk'; + model: string; service_tier?: ServiceTier; /** * This fingerprint represents the backend configuration that the model runs with. @@ -3139,6 +3135,10 @@ export type CreateChatCompletionStreamResponse = { * @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 @@ -3154,6 +3154,18 @@ export type CreateChatCompletionStreamResponse = { }; 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. * @@ -3200,11 +3212,6 @@ export type CreateCompletionRequest = { * */ max_tokens?: number; - /** - * 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'; /** * How many completions to generate for each prompt. * @@ -3219,13 +3226,6 @@ export type CreateCompletionRequest = { * */ presence_penalty?: number; - /** - * 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>; /** * 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. * @@ -3273,6 +3273,10 @@ export type CreateCompletionRequest = { * */ export type CreateCompletionResponse = { + /** + * A unique identifier for the completion. + */ + id: string; /** * The list of completion choices the model generated for the input prompt. */ @@ -3299,18 +3303,10 @@ export type CreateCompletionResponse = { * The Unix timestamp (in seconds) of when the completion was created. */ created: number; - /** - * A unique identifier for the completion. - */ - id: string; /** * The model used for completion. */ model: string; - /** - * The object type, which is always "text_completion" - */ - object: 'text_completion'; /** * This fingerprint represents the backend configuration that the model runs with. * @@ -3318,10 +3314,22 @@ export type CreateCompletionResponse = { * */ 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. */ @@ -3332,38 +3340,21 @@ export type CreateContainerBody = { anchor: 'last_active_at'; minutes: number; }; - /** - * IDs of files to copy to the container. - */ - file_ids?: Array; - /** - * Name of the container to create. - */ - name: string; }; export type CreateContainerFileBody = { + /** + * Name of the file to create. + */ + file_id?: string; /** * The File object (not file name) to be uploaded. * */ file?: Blob | File; - /** - * Name of the file to create. - */ - file_id?: string; }; export type CreateEmbeddingRequest = { - /** - * The number of dimensions the resulting output embeddings should have. Only supported in `text-embedding-3` and later models. - * - */ - dimensions?: number; - /** - * The format to return the embeddings in. Can be either `float` or [`base64`](https://pypi.org/project/pybase64/). - */ - encoding_format?: 'float' | 'base64'; /** * 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. * @@ -3374,6 +3365,15 @@ export type CreateEmbeddingRequest = { * */ 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). * @@ -3416,11 +3416,19 @@ export type CreateEmbeddingResponse = { * */ 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}}. */ @@ -3432,30 +3440,34 @@ export type CreateEvalCompletionsRunDataSource = { type?: 'EvalItem'; } & EvalItem) >; - /** - * The type of input messages. Always `template`. - */ - type: 'template'; } | { - /** - * A reference to a variable in the `item` namespace. Ie, "item.input_trajectory" - */ - item_reference: string; /** * 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; }; - /** - * The name of the model to use for generating completions (e.g. "o3-mini"). - */ - model?: 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; + /** + * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + */ + top_p?: number; + /** + * A seed value to initialize the randomness, during sampling. + */ + seed?: number; /** * An object specifying the format that the model must output. * @@ -3470,24 +3482,16 @@ export type CreateEvalCompletionsRunDataSource = { * */ response_format?: ResponseFormatText | ResponseFormatJsonSchema | ResponseFormatJsonObject; - /** - * A seed value to initialize the randomness, during sampling. - */ - seed?: number; - /** - * A higher temperature increases randomness in the outputs. - */ - temperature?: number; /** * 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. * */ tools?: Array; - /** - * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. - */ - top_p?: number; }; + /** + * 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. */ @@ -3501,10 +3505,6 @@ export type CreateEvalCompletionsRunDataSource = { | ({ type?: 'EvalStoredCompletionsSource'; } & EvalStoredCompletionsSource); - /** - * The type of run data source. Always `completions`. - */ - type: 'completions'; }; /** @@ -3518,9 +3518,9 @@ export type CreateEvalCompletionsRunDataSource = { */ export type CreateEvalCustomDataSourceConfig = { /** - * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) + * The type of data source. Always `custom`. */ - include_sample_schema?: boolean; + type: 'custom'; /** * The json schema for each row in the data source. */ @@ -3528,9 +3528,9 @@ export type CreateEvalCustomDataSourceConfig = { [key: string]: unknown; }; /** - * The type of data source. Always `custom`. + * Whether the eval should expect you to populate the sample namespace (ie, by generating responses off of your data source) */ - type: 'custom'; + include_sample_schema?: boolean; }; /** @@ -3540,14 +3540,14 @@ export type CreateEvalCustomDataSourceConfig = { */ export type CreateEvalItem = | { - /** - * The content of the message. - */ - content: string; /** * The role of the message (e.g. "system", "assistant", "user"). */ role: string; + /** + * The content of the message. + */ + content: string; } | EvalItem; @@ -3558,6 +3558,10 @@ export type CreateEvalItem = * */ export type CreateEvalJsonlRunDataSource = { + /** + * The type of data source. Always `jsonl`. + */ + type: 'jsonl'; /** * Determines what populates the `item` namespace in the data source. */ @@ -3568,10 +3572,6 @@ export type CreateEvalJsonlRunDataSource = { | ({ type?: 'EvalJsonlFileIdSource'; } & EvalJsonlFileIdSource); - /** - * The type of data source. Always `jsonl`. - */ - type: 'jsonl'; }; /** @@ -3583,29 +3583,29 @@ export type CreateEvalJsonlRunDataSource = { */ export type CreateEvalLabelModelGrader = { /** - * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. + * The object type, which is always `label_model`. */ - input: Array; + type: 'label_model'; /** - * The labels to classify to each item in the evaluation. + * The name of the grader. */ - labels: Array; + name: string; /** * The model to use for the evaluation. Must support structured outputs. */ model: string; /** - * The name of the grader. + * A list of chat messages forming the prompt or context. May include variable references to the `item` namespace, ie {{item.name}}. */ - name: string; + input: Array; /** - * The labels that indicate a passing result. Must be a subset of labels. + * The labels to classify to each item in the evaluation. */ - passing_labels: Array; + labels: Array; /** - * The object type, which is always `label_model`. + * The labels that indicate a passing result. Must be a subset of labels. */ - type: 'label_model'; + passing_labels: Array; }; /** @@ -3616,22 +3616,27 @@ export type CreateEvalLabelModelGrader = { * */ export type CreateEvalLogsDataSourceConfig = { + /** + * The type of data source. Always `logs`. + */ + type: 'logs'; /** * Metadata filters for the logs data source. */ metadata?: { [key: string]: unknown; }; - /** - * The type of data source. Always `logs`. - */ - type: 'logs'; }; /** * 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. */ @@ -3645,11 +3650,6 @@ export type CreateEvalRequest = { | ({ type?: 'CreateEvalStoredCompletionsDataSourceConfig'; } & CreateEvalStoredCompletionsDataSourceConfig); - metadata?: Metadata; - /** - * The name of the evaluation. - */ - name?: string; /** * 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}}`). */ @@ -3679,69 +3679,63 @@ export type CreateEvalRequest = { * */ 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 content of the message. - */ - content: string; /** * 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 `template`. - */ - type: 'template'; } | { - /** - * A reference to a variable in the `item` namespace. Ie, "item.name" - */ - item_reference: string; /** * 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; }; - /** - * The name of the model to use for generating completions (e.g. "o3-mini"). - */ - model?: string; sampling_params?: { /** - * The maximum number of tokens in the generated output. + * A higher temperature increases randomness in the outputs. */ - max_completion_tokens?: number; + temperature?: number; /** - * A seed value to initialize the randomness, during sampling. + * The maximum number of tokens in the generated output. */ - seed?: number; + max_completion_tokens?: number; /** - * A higher temperature increases randomness in the outputs. + * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. */ - temperature?: number; + top_p?: 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) - * + * A seed value to initialize the randomness, during sampling. */ - text?: { - format?: TextResponseFormatConfiguration; - }; + seed?: number; /** * 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. @@ -3759,10 +3753,20 @@ export type CreateEvalResponsesRunDataSource = { */ tools?: Array; /** - * An alternative to temperature for nucleus sampling; 1.0 includes all tokens. + * 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) + * */ - top_p?: number; + 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. */ @@ -3776,16 +3780,17 @@ export type CreateEvalResponsesRunDataSource = { | ({ type?: 'EvalResponsesSource'; } & EvalResponsesSource); - /** - * The type of run data source. Always `responses`. - */ - type: 'responses'; }; /** * CreateEvalRunRequest */ export type CreateEvalRunRequest = { + /** + * The name of the run. + */ + name?: string; + metadata?: Metadata; /** * Details about the run's data source. */ @@ -3793,11 +3798,6 @@ export type CreateEvalRunRequest = { | CreateEvalJsonlRunDataSource | CreateEvalCompletionsRunDataSource | CreateEvalResponsesRunDataSource; - metadata?: Metadata; - /** - * The name of the run. - */ - name?: string; }; /** @@ -3809,26 +3809,26 @@ export type CreateEvalRunRequest = { * @deprecated */ 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; }; - /** - * The type of data source. Always `stored_completions`. - */ - type: 'stored_completions'; }; export type CreateFileRequest = { - expires_after?: FileExpirationAfter; /** * The File object (not file name) to be uploaded. * */ file: Blob | File; purpose: FilePurpose; + expires_after?: FileExpirationAfter; }; export type CreateFineTuningCheckpointPermissionRequest = { @@ -3839,6 +3839,25 @@ export type CreateFineTuningCheckpointPermissionRequest = { }; 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. @@ -3866,6 +3885,27 @@ export type CreateFineTuningJobRequest = { */ 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. */ @@ -3883,21 +3923,21 @@ export type CreateFineTuningJobRequest = { */ wandb: { /** - * 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. + * The name of the project that the new run will be created under. * */ - entity?: string; + 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 name of the project that the new run will be created under. + * 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. * */ - project: string; + 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}". @@ -3906,57 +3946,36 @@ export type CreateFineTuningJobRequest = { tags?: Array; }; }>; - metadata?: Metadata; - method?: FineTuneMethod; - /** - * 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 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 = { /** - * A string of up to 64 characters that will be added to your fine-tuned model name. + * The image(s) to edit. Must be a supported image file or an array of images. * - * For example, a `suffix` of "custom-model-name" would produce a model name like `ft:gpt-4o-mini:openai:custom-model-name:7p4lURel`. + * 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. * */ - suffix?: string; + image: Blob | File | Array; /** - * 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. - * + * 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`. */ - training_file: string; + prompt: 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. - * + * 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`. */ - validation_file?: string; -}; - -export type CreateImageEditRequest = { + 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 @@ -3968,22 +3987,6 @@ export type CreateImageEditRequest = { * */ background?: 'transparent' | 'opaque' | 'auto'; - /** - * 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; - input_fidelity?: ImageInputFidelity; - /** - * 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; /** * 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. */ @@ -3993,12 +3996,13 @@ export type CreateImageEditRequest = { */ n?: number; /** - * 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 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`. */ - output_compression?: number; + 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`. @@ -4006,74 +4010,46 @@ export type CreateImageEditRequest = { * */ output_format?: 'png' | 'jpeg' | 'webp'; - partial_images?: PartialImages; - /** - * 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; /** - * 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`. + * 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. * */ - quality?: 'standard' | 'low' | 'medium' | 'high' | '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'; + output_compression?: 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`. + * 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). + * */ - size?: '256x256' | '512x512' | '1024x1024' | '1536x1024' | '1024x1536' | 'auto'; + 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; /** - * 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 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`. * */ - user?: string; + quality?: 'standard' | 'low' | 'medium' | 'high' | 'auto'; }; export type CreateImageRequest = { /** - * 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`. - * + * 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`. */ - background?: 'transparent' | 'opaque' | 'auto'; + 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'; - /** - * 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'; /** * The number of images to generate. Must be between 1 and 10. For `dall-e-3`, only `n=1` is supported. */ n?: number; - /** - * 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; - /** - * 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'; - partial_images?: PartialImages; - /** - * 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 quality of the image that will be generated. * @@ -4089,17 +4065,13 @@ export type CreateImageRequest = { */ response_format?: 'url' | 'b64_json'; /** - * 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`. + * 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`. */ - size?: - | 'auto' - | '1024x1024' - | '1536x1024' - | '1024x1536' - | '256x256' - | '512x512' - | '1792x1024' - | '1024x1792'; + 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. @@ -4107,6 +4079,34 @@ export type CreateImageRequest = { * */ 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. */ @@ -4147,6 +4147,26 @@ export type CreateImageVariationRequest = { }; 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. */ @@ -4167,27 +4187,7 @@ export type CreateMessageRequest = { } & AssistantToolsFileSearchTypeOnly) >; }>; - content: - | string - | Array< - | ({ - type?: 'MessageContentImageFileObject'; - } & MessageContentImageFileObject) - | ({ - type?: 'MessageContentImageUrlObject'; - } & MessageContentImageUrlObject) - | ({ - type?: 'MessageRequestContentTextObject'; - } & MessageRequestContentTextObject) - >; metadata?: Metadata; - /** - * 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'; }; export type CreateModelResponseProperties = ModelResponseProperties & { @@ -4246,18 +4246,14 @@ export type CreateModerationResponse = { * 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 harassing language towards any target. - */ - harassment: boolean; - /** - * Harassment content that also includes violence or serious harm towards any target. - */ - 'harassment/threatening': boolean; /** * 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. */ @@ -4266,6 +4262,14 @@ export type CreateModerationResponse = { * 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. */ @@ -4278,14 +4282,14 @@ export type CreateModerationResponse = { * Content that promotes, encourages, or depicts acts of self-harm, such as suicide, cutting, and eating disorders. */ 'self-harm': 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 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). */ @@ -4304,128 +4308,136 @@ export type CreateModerationResponse = { 'violence/graphic': boolean; }; /** - * A list of the categories along with the input type(s) that the score applies to. + * A list of the categories along with their scores as predicted by model. */ - category_applied_input_types: { + category_scores: { /** - * The applied input type(s) for the category 'harassment'. + * The score for the category 'hate'. */ - harassment: Array<'text'>; + hate: number; /** - * The applied input type(s) for the category 'harassment/threatening'. + * The score for the category 'hate/threatening'. */ - 'harassment/threatening': Array<'text'>; + 'hate/threatening': number; /** - * The applied input type(s) for the category 'hate'. + * The score for the category 'harassment'. */ - hate: Array<'text'>; + harassment: number; /** - * The applied input type(s) for the category 'hate/threatening'. + * The score for the category 'harassment/threatening'. */ - 'hate/threatening': Array<'text'>; + 'harassment/threatening': number; /** - * The applied input type(s) for the category 'illicit'. + * The score for the category 'illicit'. */ - illicit: Array<'text'>; + illicit: number; /** - * The applied input type(s) for the category 'illicit/violent'. + * The score for the category 'illicit/violent'. */ - 'illicit/violent': Array<'text'>; + 'illicit/violent': number; /** - * The applied input type(s) for the category 'self-harm'. + * The score for the category 'self-harm'. */ - 'self-harm': Array<'text' | 'image'>; + 'self-harm': number; /** - * The applied input type(s) for the category 'self-harm/instructions'. + * The score for the category 'self-harm/intent'. */ - 'self-harm/instructions': Array<'text' | 'image'>; + 'self-harm/intent': number; /** - * The applied input type(s) for the category 'self-harm/intent'. + * The score for the category 'self-harm/instructions'. */ - 'self-harm/intent': Array<'text' | 'image'>; + 'self-harm/instructions': number; /** - * The applied input type(s) for the category 'sexual'. + * The score for the category 'sexual'. */ - sexual: Array<'text' | 'image'>; + sexual: number; /** - * The applied input type(s) for the category 'sexual/minors'. + * The score for the category 'sexual/minors'. */ - 'sexual/minors': Array<'text'>; + 'sexual/minors': number; /** - * The applied input type(s) for the category 'violence'. + * The score for the category 'violence'. */ - violence: Array<'text' | 'image'>; + violence: number; /** - * The applied input type(s) for the category 'violence/graphic'. + * The score for the category 'violence/graphic'. */ - 'violence/graphic': Array<'text' | 'image'>; + 'violence/graphic': number; }; /** - * A list of the categories along with their scores as predicted by model. + * A list of the categories along with the input type(s) that the score applies to. */ - category_scores: { + category_applied_input_types: { /** - * The score for the category 'harassment'. + * The applied input type(s) for the category 'hate'. */ - harassment: number; + hate: Array<'text'>; /** - * The score for the category 'harassment/threatening'. + * The applied input type(s) for the category 'hate/threatening'. */ - 'harassment/threatening': number; + 'hate/threatening': Array<'text'>; /** - * The score for the category 'hate'. + * The applied input type(s) for the category 'harassment'. */ - hate: number; + harassment: Array<'text'>; /** - * The score for the category 'hate/threatening'. + * The applied input type(s) for the category 'harassment/threatening'. */ - 'hate/threatening': number; + 'harassment/threatening': Array<'text'>; /** - * The score for the category 'illicit'. + * The applied input type(s) for the category 'illicit'. */ - illicit: number; + illicit: Array<'text'>; /** - * The score for the category 'illicit/violent'. + * The applied input type(s) for the category 'illicit/violent'. */ - 'illicit/violent': number; + 'illicit/violent': Array<'text'>; /** - * The score for the category 'self-harm'. + * The applied input type(s) for the category 'self-harm'. */ - 'self-harm': number; + 'self-harm': Array<'text' | 'image'>; /** - * The score for the category 'self-harm/instructions'. + * The applied input type(s) for the category 'self-harm/intent'. */ - 'self-harm/instructions': number; + 'self-harm/intent': Array<'text' | 'image'>; /** - * The score for the category 'self-harm/intent'. + * The applied input type(s) for the category 'self-harm/instructions'. */ - 'self-harm/intent': number; + 'self-harm/instructions': Array<'text' | 'image'>; /** - * The score for the category 'sexual'. + * The applied input type(s) for the category 'sexual'. */ - sexual: number; + sexual: Array<'text' | 'image'>; /** - * The score for the category 'sexual/minors'. + * The applied input type(s) for the category 'sexual/minors'. */ - 'sexual/minors': number; + 'sexual/minors': Array<'text'>; /** - * The score for the category 'violence'. + * The applied input type(s) for the category 'violence'. */ - violence: number; + violence: Array<'text' | 'image'>; /** - * The score for the category 'violence/graphic'. + * The applied input type(s) for the category 'violence/graphic'. */ - 'violence/graphic': number; + 'violence/graphic': Array<'text' | 'image'>; }; - /** - * Whether any of the below categories are flagged. - */ - flagged: boolean; }>; }; 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: @@ -4445,17 +4457,16 @@ export type CreateResponse = CreateModelResponseProperties & */ include?: Array; /** - * Text, image, or file inputs to the model, used to generate a response. + * Whether to allow the model to run tool calls in parallel. * - * 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) + */ + parallel_tool_calls?: boolean; + /** + * Whether to store the generated model response for later retrieval via + * API. * */ - input?: string | Array; + store?: boolean; /** * A system (or developer) message inserted into the model's context. * @@ -4465,17 +4476,6 @@ export type CreateResponse = CreateModelResponseProperties & * */ instructions?: string; - /** - * 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; /** * 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). @@ -4488,6 +4488,19 @@ export type CreateResponse = CreateModelResponseProperties & }; 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. */ @@ -4497,57 +4510,49 @@ export type CreateRunRequest = { */ additional_messages?: Array; /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) to use to execute this run. - */ - assistant_id: string; - /** - * 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. + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. */ - instructions?: string; + tools?: Array; + metadata?: Metadata; /** - * 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. + * 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. * */ - max_completion_tokens?: number; + temperature?: 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. + * 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. * */ - max_prompt_tokens?: number; - metadata?: Metadata; - /** - * 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; - parallel_tool_calls?: ParallelToolCalls; - reasoning_effort?: ReasoningEffort; - response_format?: AssistantsApiResponseFormatOption; + 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; /** - * 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 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. * */ - temperature?: number; - tool_choice?: AssistantsApiToolChoiceOption & unknown; - /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - */ - tools?: Array; + max_prompt_tokens?: 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. + * 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. * */ - top_p?: number; + 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. */ @@ -4557,10 +4562,9 @@ export type CreateSpeechRequest = { */ instructions?: string; /** - * One of the available [TTS models](https://platform.openai.com/docs/models#tts): `tts-1`, `tts-1-hd` or `gpt-4o-mini-tts`. - * + * 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). */ - model: string | 'tts-1' | 'tts-1-hd' | 'gpt-4o-mini-tts'; + voice: VoiceIdsShared; /** * The format to audio in. Supported formats are `mp3`, `opus`, `aac`, `flac`, `wav`, and `pcm`. */ @@ -4573,10 +4577,6 @@ export type CreateSpeechRequest = { * 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'; - /** - * 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; }; export type CreateSpeechResponseStreamEvent = @@ -4592,21 +4592,7 @@ 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; - /** - * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - */ - instructions?: string; - /** - * 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; - /** - * 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; - metadata?: Metadata; + 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. */ @@ -4650,20 +4636,14 @@ export type CreateThreadAndRunRequest = { | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'; - parallel_tool_calls?: ParallelToolCalls; - response_format?: AssistantsApiResponseFormatOption; /** - * 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. - * + * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. */ - stream?: boolean; + instructions?: 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. - * + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. */ - temperature?: number; - thread?: CreateThreadRequest; - tool_choice?: AssistantsApiToolChoiceOption & unknown; + 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. * @@ -4684,10 +4664,12 @@ export type CreateThreadAndRunRequest = { vector_store_ids?: Array; }; }; + metadata?: Metadata; /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + * 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. + * */ - tools?: Array; + 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. * @@ -4695,7 +4677,25 @@ export type CreateThreadAndRunRequest = { * */ 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; }; /** @@ -4708,7 +4708,6 @@ export type CreateThreadRequest = { * A list of [messages](https://platform.openai.com/docs/api-reference/messages) to start the thread with. */ messages?: Array; - metadata?: Metadata; /** * 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. * @@ -4732,6 +4731,11 @@ export type CreateThreadRequest = { * */ 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. */ @@ -4743,7 +4747,15 @@ export type CreateThreadRequest = { 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`. * @@ -4751,59 +4763,42 @@ export type CreateThreadRequest = { * */ 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; }; - /** - * Always `static`. - */ - type: 'static'; }; - /** - * 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; metadata?: Metadata; }>; }; }; + metadata?: Metadata; }; export type CreateTranscriptionRequest = { - chunking_strategy?: TranscriptionChunkingStrategy; /** * 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; /** - * 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`. + * 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). * */ - include?: Array; + 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; - /** - * 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'; /** * 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). @@ -4814,44 +4809,49 @@ export type CreateTranscriptionRequest = { * */ stream?: boolean; + chunking_strategy?: TranscriptionChunkingStrategy; /** - * 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. + * 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. * */ - temperature?: number; + timestamp_granularities?: Array<'word' | 'segment'>; /** - * 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. + * 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`. * */ - timestamp_granularities?: Array<'word' | 'segment'>; + 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 bytes of the token. + * The token in the transcription. */ - bytes?: Array; + token?: string; /** * The log probability of the token. */ logprob?: number; /** - * The token in the transcription. + * The bytes of the token. */ - token?: string; + bytes?: Array; }>; - /** - * The transcribed text. - */ - text: string; /** * Token usage statistics for the request. */ @@ -4876,27 +4876,27 @@ export type CreateTranscriptionResponseStreamEvent = * Represents a verbose json transcription response returned by model, based on the provided input. */ export type CreateTranscriptionResponseVerboseJson = { - /** - * The duration of the input audio. - */ - duration: number; /** * The language of the input audio. */ language: string; /** - * Segments of the transcribed text and their corresponding details. + * The duration of the input audio. */ - segments?: Array; + duration: number; /** * The transcribed text. */ text: string; - usage?: TranscriptTextUsageDuration; /** * Extracted words and their corresponding timestamps. */ words?: Array; + /** + * Segments of the transcribed text and their corresponding details. + */ + segments?: Array; + usage?: TranscriptTextUsageDuration; }; export type CreateTranslationRequest = { @@ -4932,82 +4932,82 @@ export type CreateTranslationResponseJson = { }; export type CreateTranslationResponseVerboseJson = { - /** - * The duration of the input audio. - */ - duration: number; /** * The language of the output translation (always `english`). */ language: string; /** - * Segments of the translated text and their corresponding details. + * The duration of the input audio. */ - segments?: Array; + duration: number; /** * The translated text. */ text: string; + /** + * Segments of the translated text and their corresponding details. + */ + segments?: Array; }; export type CreateUploadRequest = { - /** - * The number of bytes in the file you are uploading. - * - */ - bytes: number; - expires_after?: FileExpirationAfter; /** * The name of the file to upload. * */ filename: string; /** - * The MIME type of the file. + * The intended purpose of the uploaded file. * - * This must fall within the supported MIME types for your file purpose. See the supported MIME types for assistants and vision. + * See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). * */ - mime_type: string; + purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision'; /** - * The intended purpose of the uploaded file. + * The number of bytes in the file you are uploading. * - * See the [documentation on File purposes](https://platform.openai.com/docs/api-reference/files/create#files-create-purpose). + */ + 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. * */ - purpose: 'assistants' | 'batch' | 'fine-tune' | 'vision'; + mime_type: string; + expires_after?: FileExpirationAfter; }; export type CreateVectorStoreFileBatchRequest = { - attributes?: VectorStoreFileAttributes; - chunking_strategy?: ChunkingStrategyRequestParam; /** * 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 = { - attributes?: VectorStoreFileAttributes; - chunking_strategy?: ChunkingStrategyRequestParam; /** * 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 = { - chunking_strategy?: ChunkingStrategyRequestParam; - expires_after?: VectorStoreExpirationAfter; /** * 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; - metadata?: Metadata; /** * The name of the vector store. */ name?: string; + expires_after?: VectorStoreExpirationAfter; + chunking_strategy?: ChunkingStrategyRequestParam; + metadata?: Metadata; }; /** @@ -5018,6 +5018,14 @@ export type CreateVectorStoreRequest = { * */ 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. * @@ -5035,6 +5043,10 @@ export type CustomTool = { type: 'text'; } | { + /** + * Grammar format. Always `grammar`. + */ + type: 'grammar'; /** * The grammar definition. */ @@ -5043,19 +5055,7 @@ export type CustomTool = { * The syntax of the grammar definition. One of `lark` or `regex`. */ syntax: 'lark' | 'regex'; - /** - * Grammar format. Always `grammar`. - */ - type: 'grammar'; }; - /** - * The name of the custom tool, used to identify it in tool calls. - */ - name: string; - /** - * The type of the custom tool. Always `custom`. - */ - type: 'custom'; }; /** @@ -5066,30 +5066,30 @@ export type CustomTool = { */ export type CustomToolCall = { /** - * An identifier used to map this custom tool call to a tool call output. + * The type of the custom tool call. Always `custom_tool_call`. * */ - call_id: string; + type: 'custom_tool_call'; /** * The unique ID of the custom tool call in the OpenAI platform. * */ id?: string; /** - * The input for the custom tool call generated by the model. + * An identifier used to map this custom tool call to a tool call output. * */ - input: string; + call_id: string; /** * The name of the custom tool being called. * */ name: string; /** - * The type of the custom tool call. Always `custom_tool_call`. + * The input for the custom tool call generated by the model. * */ - type: 'custom_tool_call'; + input: string; }; /** @@ -5100,25 +5100,25 @@ export type CustomToolCall = { */ export type CustomToolCallOutput = { /** - * The call ID, used to map this custom tool call output to a custom tool call. + * The type of the custom tool call output. Always `custom_tool_call_output`. * */ - call_id: string; + type: 'custom_tool_call_output'; /** * The unique ID of the custom tool call output in the OpenAI platform. * */ id?: string; /** - * The output from the custom tool call generated by your code. + * The call ID, used to map this custom tool call output to a custom tool call. * */ - output: string; + call_id: string; /** - * The type of the custom tool call output. Always `custom_tool_call_output`. + * The output from the custom tool call generated by your code. * */ - type: 'custom_tool_call_output'; + output: string; }; /** @@ -5128,6 +5128,10 @@ export type CustomToolCallOutput = { * */ export type CustomToolChatCompletions = { + /** + * The type of the custom tool. Always `custom`. + */ + type: 'custom'; /** * Custom tool properties * @@ -5135,6 +5139,10 @@ export type CustomToolChatCompletions = { * */ 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. * @@ -5152,6 +5160,10 @@ export type CustomToolChatCompletions = { type: 'text'; } | { + /** + * Grammar format. Always `grammar`. + */ + type: 'grammar'; /** * Grammar format * @@ -5167,50 +5179,34 @@ export type CustomToolChatCompletions = { */ syntax: 'lark' | 'regex'; }; - /** - * Grammar format. Always `grammar`. - */ - type: 'grammar'; }; - /** - * The name of the custom tool, used to identify it in tool calls. - */ - name: string; }; - /** - * The type of the custom tool. Always `custom`. - */ - type: 'custom'; }; export type DeleteAssistantResponse = { - deleted: boolean; id: string; + deleted: boolean; object: 'assistant.deleted'; }; export type DeleteCertificateResponse = { - /** - * The ID of the certificate that was deleted. - */ - id: string; /** * The object type, must be `certificate.deleted`. */ object: 'certificate.deleted'; + /** + * The ID of the certificate that was deleted. + */ + id: string; }; export type DeleteFileResponse = { - deleted: boolean; id: string; object: 'file'; + deleted: boolean; }; export type DeleteFineTuningCheckpointPermissionResponse = { - /** - * Whether the fine-tuned model checkpoint permission was successfully deleted. - */ - deleted: boolean; /** * The ID of the fine-tuned model checkpoint permission that was deleted. */ @@ -5219,35 +5215,39 @@ export type DeleteFineTuningCheckpointPermissionResponse = { * 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 = { - deleted: boolean; id: string; + deleted: boolean; object: 'thread.message.deleted'; }; export type DeleteModelResponse = { - deleted: boolean; id: string; + deleted: boolean; object: string; }; export type DeleteThreadResponse = { - deleted: boolean; id: string; + deleted: boolean; object: 'thread.deleted'; }; export type DeleteVectorStoreFileResponse = { - deleted: boolean; id: string; + deleted: boolean; object: 'vector_store.file.deleted'; }; export type DeleteVectorStoreResponse = { - deleted: boolean; id: string; + deleted: boolean; object: 'vector_store.deleted'; }; @@ -5255,8 +5255,8 @@ export type DeleteVectorStoreResponse = { * Occurs when a stream ends. */ export type DoneEvent = { - data: '[DONE]'; event: 'done'; + data: '[DONE]'; }; /** @@ -5291,6 +5291,12 @@ export type DoubleClick = { * */ 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 @@ -5303,12 +5309,6 @@ export type Drag = { * */ path: Array; - /** - * Specifies the event type. For a drag action, this property is - * always set to `drag`. - * - */ - type: 'drag'; }; /** @@ -5322,18 +5322,18 @@ export type Drag = { * */ export type EasyInputMessage = { - /** - * Text, image, or audio input to the model, used to generate a response. - * Can also contain previous assistant responses. - * - */ - content: string | InputMessageContentList; /** * 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`. * @@ -5346,15 +5346,15 @@ export type EasyInputMessage = { * */ 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 index of the embedding in the list of embeddings. - */ - index: number; /** * The object type, which is always "embedding". */ @@ -5372,8 +5372,8 @@ export type Error = { * 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 = { - data: Error; event: 'error'; + data: Error; }; export type ErrorResponse = { @@ -5393,9 +5393,17 @@ export type ErrorResponse = { */ export type Eval = { /** - * The Unix timestamp (in seconds) for when the eval was created. + * The object type. */ - created_at: number; + 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. */ @@ -5409,19 +5417,6 @@ export type Eval = { | ({ type?: 'EvalStoredCompletionsDataSourceConfig'; } & EvalStoredCompletionsDataSourceConfig); - /** - * Unique identifier for the evaluation. - */ - id: string; - metadata: Metadata; - /** - * The name of the evaluation. - */ - name: string; - /** - * The object type. - */ - object: 'eval'; /** * A list of testing criteria. */ @@ -5432,6 +5427,11 @@ export type Eval = { | EvalGraderPython | EvalGraderScoreModel >; + /** + * The Unix timestamp (in seconds) for when the eval was created. + */ + created_at: number; + metadata: Metadata; }; /** @@ -5461,6 +5461,10 @@ export type EvalApiError = { * */ 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/). @@ -5469,10 +5473,6 @@ export type EvalCustomDataSourceConfig = { schema: { [key: string]: unknown; }; - /** - * The type of data source. Always `custom`. - */ - type: 'custom'; }; /** @@ -5526,6 +5526,12 @@ export type EvalGraderTextSimilarity = GraderTextSimilarity & { * */ 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. * @@ -5535,40 +5541,34 @@ export type EvalItem = { | InputTextContent | { /** - * The text output from the model. + * The type of the output text. Always `output_text`. * */ - text: string; + type: 'output_text'; /** - * The type of the output text. Always `output_text`. + * The text output from the model. * */ - type: 'output_text'; + text: string; } | { /** - * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + * The type of the image input. Always `input_image`. * */ - detail?: string; + type: 'input_image'; /** * The URL of the image input. * */ image_url: string; /** - * The type of the image input. Always `input_image`. + * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. * */ - type: 'input_image'; + detail?: string; } | Array; - /** - * The role of the message input. One of `user`, `assistant`, `system`, or - * `developer`. - * - */ - role: 'user' | 'assistant' | 'system' | 'developer'; /** * The type of the message input. Always `message`. * @@ -5580,6 +5580,10 @@ export type EvalItem = { * EvalJsonlFileContentSource */ export type EvalJsonlFileContentSource = { + /** + * The type of jsonl source. Always `file_content`. + */ + type: 'file_content'; /** * The content of the jsonl file. */ @@ -5591,24 +5595,20 @@ export type EvalJsonlFileContentSource = { [key: string]: unknown; }; }>; - /** - * The type of jsonl source. Always `file_content`. - */ - type: 'file_content'; }; /** * EvalJsonlFileIdSource */ export type EvalJsonlFileIdSource = { - /** - * The identifier of the file. - */ - id: string; /** * The type of jsonl source. Always `file_id`. */ type: 'file_id'; + /** + * The identifier of the file. + */ + id: string; }; /** @@ -5618,6 +5618,11 @@ export type EvalJsonlFileIdSource = { * */ export type EvalList = { + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; /** * An array of eval objects. * @@ -5627,19 +5632,14 @@ export type EvalList = { * The identifier of the first eval in the data array. */ first_id: string; - /** - * Indicates whether there are more evals available. - */ - has_more: boolean; /** * The identifier of the last eval in the data array. */ last_id: string; /** - * The type of this object. It is always set to "list". - * + * Indicates whether there are more evals available. */ - object: 'list'; + has_more: boolean; }; /** @@ -5652,6 +5652,10 @@ export type EvalList = { * */ export type EvalLogsDataSourceConfig = { + /** + * The type of data source. Always `logs`. + */ + type: 'logs'; metadata?: Metadata; /** * The json schema for the run data source items. @@ -5661,10 +5665,6 @@ export type EvalLogsDataSourceConfig = { schema: { [key: string]: unknown; }; - /** - * The type of data source. Always `logs`. - */ - type: 'logs'; }; /** @@ -5675,17 +5675,9 @@ export type EvalLogsDataSourceConfig = { */ export type EvalResponsesSource = { /** - * Only include items created after this timestamp (inclusive). This is a query parameter used to select responses. + * The type of run data source. Always `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 string to search the 'instructions' field. This is a query parameter used to select responses. - */ - instructions_search?: string; + type: 'responses'; /** * Metadata filter for the responses. This is a query parameter used to select responses. */ @@ -5696,6 +5688,18 @@ export type EvalResponsesSource = { * 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. */ @@ -5704,22 +5708,18 @@ export type EvalResponsesSource = { * Sampling temperature. This is a query parameter used to select responses. */ temperature?: number; - /** - * List of tool names. This is a query parameter used to select responses. - */ - tools?: Array; /** * Nucleus sampling parameter. This is a query parameter used to select responses. */ top_p?: number; - /** - * The type of run data source. Always `responses`. - */ - type: 'responses'; /** * 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; }; /** @@ -5730,32 +5730,21 @@ export type EvalResponsesSource = { */ export type EvalRun = { /** - * Unix timestamp (in seconds) when the evaluation run was created. + * The type of the object. Always "eval.run". */ - created_at: number; + object: 'eval.run'; /** - * Information about the run's data source. + * Unique identifier for the evaluation run. */ - data_source: - | ({ - type?: 'CreateEvalJsonlRunDataSource'; - } & CreateEvalJsonlRunDataSource) - | ({ - type?: 'CreateEvalCompletionsRunDataSource'; - } & CreateEvalCompletionsRunDataSource) - | ({ - type?: 'CreateEvalResponsesRunDataSource'; - } & CreateEvalResponsesRunDataSource); - error: EvalApiError; + id: string; /** * The identifier of the associated evaluation. */ eval_id: string; /** - * Unique identifier for the evaluation run. + * The status of the evaluation run. */ - id: string; - metadata: Metadata; + status: string; /** * The model that is evaluated, if applicable. */ @@ -5765,84 +5754,95 @@ export type EvalRun = { */ name: string; /** - * The type of the object. Always "eval.run". + * Unix timestamp (in seconds) when the evaluation run was created. */ - object: 'eval.run'; + created_at: number; /** - * Usage statistics for each model during the evaluation run. + * The URL to the rendered evaluation run report on the UI dashboard. */ - per_model_usage: Array<{ + report_url: string; + /** + * Counters summarizing the outcomes of the evaluation run. + */ + result_counts: { /** - * The number of tokens retrieved from cache. + * Total number of executed output items. */ - cached_tokens: number; + total: number; /** - * The number of completion tokens generated. + * Number of output items that resulted in an error. */ - completion_tokens: number; + errored: number; /** - * The number of invocations. + * Number of output items that failed to pass the evaluation. */ - invocation_count: number; + 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<{ - /** - * Number of tests failed for this criteria. - */ - failed: number; - /** - * Number of tests passed for this criteria. - */ - passed: number; /** * A description of the testing criteria. */ testing_criteria: string; - }>; - /** - * 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: { - /** - * 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. + * Number of tests passed for this criteria. */ passed: number; /** - * Total number of executed output items. + * Number of tests failed for this criteria. */ - total: number; - }; + failed: number; + }>; /** - * The status of the evaluation run. + * Information about the run's data source. */ - status: string; + data_source: + | ({ + type?: 'CreateEvalJsonlRunDataSource'; + } & CreateEvalJsonlRunDataSource) + | ({ + type?: 'CreateEvalCompletionsRunDataSource'; + } & CreateEvalCompletionsRunDataSource) + | ({ + type?: 'CreateEvalResponsesRunDataSource'; + } & CreateEvalResponsesRunDataSource); + metadata: Metadata; + error: EvalApiError; }; /** @@ -5852,6 +5852,11 @@ export type EvalRun = { * */ export type EvalRunList = { + /** + * The type of this object. It is always set to "list". + * + */ + object: 'list'; /** * An array of eval run objects. * @@ -5861,19 +5866,14 @@ export type EvalRunList = { * The identifier of the first eval run in the data array. */ first_id: string; - /** - * Indicates whether there are more evals available. - */ - has_more: boolean; /** * The identifier of the last eval run in the data array. */ last_id: string; /** - * The type of this object. It is always set to "list". - * + * Indicates whether there are more evals available. */ - object: 'list'; + has_more: boolean; }; /** @@ -5884,104 +5884,91 @@ export type EvalRunList = { */ export type EvalRunOutputItem = { /** - * Unix timestamp (in seconds) when the evaluation run was created. + * The type of the object. Always "eval.run.output_item". */ - created_at: number; + object: 'eval.run.output_item'; /** - * Details of the input data source item. + * Unique identifier for the evaluation run output item. */ - datasource_item: { - [key: string]: unknown; - }; + id: string; /** - * The identifier for the data source item. + * The identifier of the evaluation run associated with this output item. */ - datasource_item_id: number; + run_id: string; /** * The identifier of the evaluation group. */ eval_id: string; /** - * Unique identifier for the evaluation run output item. + * Unix timestamp (in seconds) when the evaluation run was created. */ - id: string; + created_at: number; /** - * The type of the object. Always "eval.run.output_item". + * The status of the evaluation run. */ - object: 'eval.run.output_item'; + 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; }>; - /** - * The identifier of the evaluation run associated with this output item. - */ - run_id: string; /** * A sample containing the input and output of the evaluation run. */ sample: { - error: EvalApiError; - /** - * The reason why the sample generation was finished. - */ - finish_reason: string; /** * An array of input messages. */ input: Array<{ - /** - * The content of the message. - */ - content: string; /** * The role of the message sender (e.g., system, user, developer). */ role: string; + /** + * The content of the message. + */ + content: string; }>; - /** - * The maximum number of tokens allowed for completion. - */ - max_completion_tokens: number; - /** - * The model used for generating the sample. - */ - model: string; /** * An array of output messages. */ output: Array<{ - /** - * The content of the message. - */ - content?: string; /** * The role of the message (e.g. "system", "assistant", "user"). */ role?: string; + /** + * The content of the message. + */ + content?: string; }>; /** - * The seed used for generating the sample. - */ - seed: number; - /** - * The sampling temperature used. + * The reason why the sample generation was finished. */ - temperature: number; + finish_reason: string; /** - * The top_p value used for sampling. + * The model used for generating the sample. */ - top_p: number; + model: string; /** * Token usage details for the sample. */ usage: { /** - * The number of tokens retrieved from cache. + * The total number of tokens used. */ - cached_tokens: number; + total_tokens: number; /** * The number of completion tokens generated. */ @@ -5991,24 +5978,42 @@ export type EvalRunOutputItem = { */ prompt_tokens: number; /** - * The total number of tokens used. + * The number of tokens retrieved from cache. */ - total_tokens: number; + cached_tokens: number; }; - }; - /** - * The status of the evaluation run. - */ - status: string; -}; - -/** - * EvalRunOutputItemList + 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. * @@ -6018,19 +6023,14 @@ export type EvalRunOutputItemList = { * The identifier of the first eval run output item in the data array. */ first_id: string; - /** - * Indicates whether there are more eval run output items available. - */ - has_more: boolean; /** * The identifier of the last eval run output item in the data array. */ last_id: string; /** - * The type of this object. It is always set to "list". - * + * Indicates whether there are more eval run output items available. */ - object: 'list'; + has_more: boolean; }; /** @@ -6042,6 +6042,10 @@ export type EvalRunOutputItemList = { * @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. @@ -6051,10 +6055,6 @@ export type EvalStoredCompletionsDataSourceConfig = { schema: { [key: string]: unknown; }; - /** - * The type of data source. Always `stored_completions`. - */ - type: 'stored_completions'; }; /** @@ -6064,6 +6064,15 @@ export type EvalStoredCompletionsDataSourceConfig = { * */ 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. */ @@ -6076,15 +6085,6 @@ export type EvalStoredCompletionsSource = { * An optional maximum number of items to return. */ limit?: number; - metadata?: Metadata; - /** - * An optional model to filter by (e.g., 'gpt-4o'). - */ - model?: string; - /** - * The type of source. Always `stored_completions`. - */ - type: 'stored_completions'; }; /** @@ -6110,6 +6110,11 @@ export type FileExpirationAfter = { * */ export type FilePath = { + /** + * The type of the file path. Always `file_path`. + * + */ + type: 'file_path'; /** * The ID of the file. * @@ -6120,11 +6125,6 @@ export type FilePath = { * */ index: number; - /** - * The type of the file path. Always `file_path`. - * - */ - type: 'file_path'; }; /** @@ -6166,6 +6166,17 @@ export type FileSearchToolCall = { * */ 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. * @@ -6176,39 +6187,28 @@ export type FileSearchToolCall = { * */ results?: Array<{ - attributes?: VectorStoreFileAttributes; /** * 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; - /** - * The text that was retrieved from the file. - * - */ - text?: string; }>; - /** - * The status of the file search tool call. One of `in_progress`, - * `searching`, `incomplete` or `failed`, - * - */ - status: 'in_progress' | 'searching' | 'completed' | 'incomplete' | 'failed'; - /** - * The type of the file search tool call. Always `file_search_call`. - * - */ - type: 'file_search_call'; }; export type FineTuneChatCompletionRequestAssistantMessage = { @@ -6225,12 +6225,6 @@ export type FineTuneChatCompletionRequestAssistantMessage = { * */ export type FineTuneChatRequestInput = { - /** - * A list of functions the model may generate JSON inputs for. - * - * @deprecated - */ - functions?: Array; messages?: Array< | ChatCompletionRequestSystemMessage | ChatCompletionRequestUserMessage @@ -6238,11 +6232,17 @@ export type FineTuneChatRequestInput = { | ChatCompletionRequestToolMessage | ChatCompletionRequestFunctionMessage >; - parallel_tool_calls?: ParallelToolCalls; /** * 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; }; /** @@ -6250,15 +6250,15 @@ export type FineTuneChatRequestInput = { */ export type FineTuneDpoHyperparameters = { /** - * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. + * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. * */ - batch_size?: 'auto' | number; + beta?: 'auto' | number; /** - * The beta value for the DPO method. A higher beta value will increase the weight of the penalty between the policy and reference model. + * Number of examples in each batch. A larger batch size means that model parameters are updated less frequently, but with lower variance. * */ - beta?: 'auto' | number; + batch_size?: 'auto' | number; /** * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. * @@ -6282,13 +6282,13 @@ export type FineTuneDpoMethod = { * The method used for fine-tuning. */ export type FineTuneMethod = { - dpo?: FineTuneDpoMethod; - reinforcement?: FineTuneReinforcementMethod; - supervised?: FineTuneSupervisedMethod; /** * The type of method. Is either `supervised`, `dpo`, or `reinforcement`. */ type: 'supervised' | 'dpo' | 'reinforcement'; + supervised?: FineTuneSupervisedMethod; + dpo?: FineTuneDpoMethod; + reinforcement?: FineTuneReinforcementMethod; }; /** @@ -6306,20 +6306,20 @@ export type FineTunePreferenceRequestInput = { | ChatCompletionRequestToolMessage | ChatCompletionRequestFunctionMessage >; - parallel_tool_calls?: ParallelToolCalls; /** * A list of tools the model may generate JSON inputs for. */ tools?: Array; + parallel_tool_calls?: ParallelToolCalls; }; - /** - * The non-preferred completion message for the output. - */ - non_preferred_output?: Array; /** * The preferred completion message for the output. */ preferred_output?: Array; + /** + * The non-preferred completion message for the output. + */ + non_preferred_output?: Array; }; /** @@ -6332,35 +6332,35 @@ export type FineTuneReinforcementHyperparameters = { */ batch_size?: 'auto' | number; /** - * Multiplier on amount of compute used for exploring search space during training. + * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. * */ - compute_multiplier?: 'auto' | number; + learning_rate_multiplier?: 'auto' | number; /** - * The number of training steps between evaluation runs. + * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. * */ - eval_interval?: 'auto' | number; + n_epochs?: 'auto' | number; /** - * Number of evaluation samples to generate per training step. + * Level of reasoning effort. * */ - eval_samples?: 'auto' | number; + reasoning_effort?: 'default' | 'low' | 'medium' | 'high'; /** - * Scaling factor for the learning rate. A smaller learning rate may be useful to avoid overfitting. + * Multiplier on amount of compute used for exploring search space during training. * */ - learning_rate_multiplier?: 'auto' | number; + compute_multiplier?: 'auto' | number; /** - * The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. + * The number of training steps between evaluation runs. * */ - n_epochs?: 'auto' | number; + eval_interval?: 'auto' | number; /** - * Level of reasoning effort. + * Number of evaluation samples to generate per training step. * */ - reasoning_effort?: 'default' | 'low' | 'medium' | 'high'; + eval_samples?: 'auto' | number; }; /** @@ -6429,22 +6429,22 @@ export type FineTuneSupervisedMethod = { * */ export type FineTuningCheckpointPermission = { - /** - * The Unix timestamp (in seconds) for when the permission was created. - */ - created_at: number; /** * The permission identifier, which can be referenced in the API endpoints. */ id: string; /** - * The object type, which is always "checkpoint.permission". + * The Unix timestamp (in seconds) for when the permission was created. */ - object: 'checkpoint.permission'; + 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'; }; /** @@ -6463,21 +6463,21 @@ export type FineTuningIntegration = { */ wandb: { /** - * 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. + * The name of the project that the new run will be created under. * */ - entity?: string; + 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 name of the project that the new run will be created under. + * 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. * */ - project: string; + 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}". @@ -6494,6 +6494,10 @@ export type FineTuningIntegration = { * */ 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. */ @@ -6515,10 +6519,6 @@ export type FineTuningJob = { */ param: string; }; - /** - * 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; /** * The name of the fine-tuned model that is being created. The value will be null if the fine-tuning job is still running. */ @@ -6550,20 +6550,6 @@ export type FineTuningJob = { */ n_epochs?: 'auto' | number; }; - /** - * The object identifier, which can be referenced in the API endpoints. - */ - id: string; - /** - * A list of integrations to enable for this fine-tuning job. - */ - integrations?: Array< - { - type?: 'FineTuningIntegration'; - } & FineTuningIntegration - >; - metadata?: Metadata; - method?: FineTuneMethod; /** * The base model that is being fine-tuned. */ @@ -6580,10 +6566,6 @@ export type FineTuningJob = { * 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 seed used for the fine-tuning job. - */ - seed: number; /** * The current status of the fine-tuning job, which can be either `validating_files`, `queued`, `running`, `succeeded`, `failed`, or `cancelled`. */ @@ -6600,6 +6582,24 @@ export type FineTuningJob = { * 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; }; /** @@ -6609,6 +6609,10 @@ 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. */ @@ -6618,33 +6622,29 @@ export type FineTuningJobCheckpoint = { */ fine_tuned_model_checkpoint: string; /** - * The name of the fine-tuning job that this checkpoint was created from. - */ - fine_tuning_job_id: string; - /** - * The checkpoint identifier, which can be referenced in the API endpoints. + * The step number that the checkpoint was created at. */ - id: string; + step_number: number; /** * Metrics at the step number during the fine-tuning job. */ metrics: { - full_valid_loss?: number; - full_valid_mean_token_accuracy?: number; 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 object type, which is always "fine_tuning.job.checkpoint". + * The name of the fine-tuning job that this checkpoint was created from. */ - object: 'fine_tuning.job.checkpoint'; + fine_tuning_job_id: string; /** - * The step number that the checkpoint was created at. + * The object type, which is always "fine_tuning.job.checkpoint". */ - step_number: number; + object: 'fine_tuning.job.checkpoint'; }; /** @@ -6652,19 +6652,17 @@ export type FineTuningJobCheckpoint = { */ export type FineTuningJobEvent = { /** - * The Unix timestamp (in seconds) for when the fine-tuning job was created. - */ - created_at: number; - /** - * The data associated with the event. + * The object type, which is always "fine_tuning.job.event". */ - data?: { - [key: string]: unknown; - }; + 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. */ @@ -6673,14 +6671,16 @@ export type FineTuningJobEvent = { * The message of the event. */ message: string; - /** - * The object type, which is always "fine_tuning.job.event". - */ - object: 'fine_tuning.job.event'; /** * The type of event. */ type?: 'message' | 'metrics'; + /** + * The data associated with the event. + */ + data?: { + [key: string]: unknown; + }; }; export type FunctionObject = { @@ -6717,36 +6717,36 @@ export type FunctionParameters = { */ export type FunctionToolCall = { /** - * A JSON string of the arguments to pass to the function. + * The unique ID of the function tool call. * */ - arguments: string; + id?: string; /** - * The unique ID of the function tool call generated by the model. + * The type of the function tool call. Always `function_call`. * */ - call_id: string; + type: 'function_call'; /** - * The unique ID of the function tool call. + * The unique ID of the function tool call generated by the model. * */ - id?: string; + call_id: string; /** * The name of the function to run. * */ name: string; /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. + * A JSON string of the arguments to pass to the function. * */ - status?: 'in_progress' | 'completed' | 'incomplete'; + arguments: string; /** - * The type of the function tool call. Always `function_call`. + * The status of the item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. * */ - type: 'function_call'; + status?: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -6756,17 +6756,22 @@ export type FunctionToolCall = { * */ export type FunctionToolCallOutput = { - /** - * The unique ID of the function tool call generated by the model. - * - */ - call_id: string; /** * 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. * @@ -6778,11 +6783,6 @@ export type FunctionToolCallOutput = { * */ status?: 'in_progress' | 'completed' | 'incomplete'; - /** - * The type of the function tool call output. Always `function_call_output`. - * - */ - type: 'function_call_output'; }; export type FunctionToolCallOutputResource = FunctionToolCallOutput & { @@ -6809,27 +6809,27 @@ export type FunctionToolCallResource = FunctionToolCall & { * */ export type GraderLabelModel = { - input: Array; /** - * The labels to assign to each item in the evaluation. + * The object type, which is always `label_model`. */ - labels: Array; + 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 name of the grader. + * The labels to assign to each item in the evaluation. */ - name: string; + 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'; }; /** @@ -6839,9 +6839,13 @@ export type GraderLabelModel = { */ export type GraderMulti = { /** - * A formula to calculate the output based on grader results. + * The object type, which is always `multi`. */ - calculate_output: string; + type: 'multi'; + /** + * The name of the grader. + */ + name: string; graders: | GraderStringCheck | GraderTextSimilarity @@ -6849,13 +6853,9 @@ export type GraderMulti = { | GraderScoreModel | GraderLabelModel; /** - * The name of the grader. - */ - name: string; - /** - * The object type, which is always `multi`. + * A formula to calculate the output based on grader results. */ - type: 'multi'; + calculate_output: string; }; /** @@ -6866,9 +6866,9 @@ export type GraderMulti = { */ export type GraderPython = { /** - * The image tag to use for the python script. + * The object type, which is always `python`. */ - image_tag?: string; + type: 'python'; /** * The name of the grader. */ @@ -6878,9 +6878,9 @@ export type GraderPython = { */ source: string; /** - * The object type, which is always `python`. + * The image tag to use for the python script. */ - type: 'python'; + image_tag?: string; }; /** @@ -6891,21 +6891,17 @@ export type GraderPython = { */ export type GraderScoreModel = { /** - * The input text. This may include template strings. - */ - input: Array; - /** - * The model to use for the evaluation. + * The object type, which is always `score_model`. */ - model: string; + type: 'score_model'; /** * The name of the grader. */ name: string; /** - * The range of the score. Defaults to `[0, 1]`. + * The model to use for the evaluation. */ - range?: Array; + model: string; /** * The sampling parameters for the model. */ @@ -6913,9 +6909,13 @@ export type GraderScoreModel = { [key: string]: unknown; }; /** - * The object type, which is always `score_model`. + * The input text. This may include template strings. */ - type: 'score_model'; + input: Array; + /** + * The range of the score. Defaults to `[0, 1]`. + */ + range?: Array; }; /** @@ -6926,25 +6926,25 @@ export type GraderScoreModel = { */ export type GraderStringCheck = { /** - * The input text. This may include template strings. + * The object type, which is always `string_check`. */ - input: string; + type: 'string_check'; /** * The name of the grader. */ name: string; /** - * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. + * The input text. This may include template strings. */ - operation: 'eq' | 'ne' | 'like' | 'ilike'; + input: string; /** * The reference text. This may include template strings. */ reference: string; /** - * The object type, which is always `string_check`. + * The string check operation to perform. One of `eq`, `ne`, `like`, or `ilike`. */ - type: 'string_check'; + operation: 'eq' | 'ne' | 'like' | 'ilike'; }; /** @@ -6954,6 +6954,22 @@ 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`, @@ -6972,22 +6988,6 @@ export type GraderTextSimilarity = { | 'rouge_4' | 'rouge_5' | 'rouge_l'; - /** - * The text being graded. - */ - input: string; - /** - * The name of the grader. - */ - name: string; - /** - * The text being graded against. - */ - reference: string; - /** - * The type of grader. - */ - type: 'text_similarity'; }; /** @@ -6998,14 +6998,14 @@ 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; - /** - * For `dall-e-3` only, the revised prompt that was used to generate the image. - */ - revised_prompt?: 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; }; /** @@ -7014,40 +7014,40 @@ export type Image = { */ export type ImageEditCompletedEvent = { /** - * Base64-encoded final edited image data, suitable for rendering as an image. + * The type of the event. Always `image_edit.completed`. * */ - b64_json: string; + type: 'image_edit.completed'; /** - * The background setting for the edited image. + * Base64-encoded final edited image data, suitable for rendering as an image. * */ - background: 'transparent' | 'opaque' | 'auto'; + b64_json: string; /** * The Unix timestamp when the event was created. * */ created_at: number; /** - * The output format for the edited image. + * The size of the edited image. * */ - output_format: 'png' | 'webp' | 'jpeg'; + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The quality setting for the edited image. * */ quality: 'low' | 'medium' | 'high' | 'auto'; /** - * The size of the edited image. + * The background setting for the edited image. * */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + background: 'transparent' | 'opaque' | 'auto'; /** - * The type of the event. Always `image_edit.completed`. + * The output format for the edited image. * */ - type: 'image_edit.completed'; + output_format: 'png' | 'webp' | 'jpeg'; usage: ImagesUsage; }; @@ -7057,45 +7057,45 @@ export type ImageEditCompletedEvent = { */ export type ImageEditPartialImageEvent = { /** - * Base64-encoded partial image data, suitable for rendering as an image. + * The type of the event. Always `image_edit.partial_image`. * */ - b64_json: string; + type: 'image_edit.partial_image'; /** - * The background setting for the requested edited image. + * Base64-encoded partial image data, suitable for rendering as an image. * */ - background: 'transparent' | 'opaque' | 'auto'; + b64_json: string; /** * The Unix timestamp when the event was created. * */ created_at: number; /** - * The output format for the requested edited image. + * The size of the requested edited image. * */ - output_format: 'png' | 'webp' | 'jpeg'; + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** - * 0-based index for the partial image (streaming). + * The quality setting for the requested edited image. * */ - partial_image_index: number; + quality: 'low' | 'medium' | 'high' | 'auto'; /** - * The quality setting for the requested edited image. + * The background setting for the requested edited image. * */ - quality: 'low' | 'medium' | 'high' | 'auto'; + background: 'transparent' | 'opaque' | 'auto'; /** - * The size of the requested edited image. + * The output format for the requested edited image. * */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + output_format: 'png' | 'webp' | 'jpeg'; /** - * The type of the event. Always `image_edit.partial_image`. + * 0-based index for the partial image (streaming). * */ - type: 'image_edit.partial_image'; + partial_image_index: number; }; export type ImageEditStreamEvent = @@ -7112,40 +7112,40 @@ export type ImageEditStreamEvent = */ export type ImageGenCompletedEvent = { /** - * Base64-encoded image data, suitable for rendering as an image. + * The type of the event. Always `image_generation.completed`. * */ - b64_json: string; + type: 'image_generation.completed'; /** - * The background setting for the generated image. + * Base64-encoded image data, suitable for rendering as an image. * */ - background: 'transparent' | 'opaque' | 'auto'; + b64_json: string; /** * The Unix timestamp when the event was created. * */ created_at: number; /** - * The output format for the generated image. + * The size of the generated image. * */ - output_format: 'png' | 'webp' | 'jpeg'; + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The quality setting for the generated image. * */ quality: 'low' | 'medium' | 'high' | 'auto'; /** - * The size of the generated image. + * The background setting for the generated image. * */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + background: 'transparent' | 'opaque' | 'auto'; /** - * The type of the event. Always `image_generation.completed`. + * The output format for the generated image. * */ - type: 'image_generation.completed'; + output_format: 'png' | 'webp' | 'jpeg'; usage: ImagesUsage; }; @@ -7155,45 +7155,45 @@ export type ImageGenCompletedEvent = { */ export type ImageGenPartialImageEvent = { /** - * Base64-encoded partial image data, suitable for rendering as an image. + * The type of the event. Always `image_generation.partial_image`. * */ - b64_json: string; + type: 'image_generation.partial_image'; /** - * The background setting for the requested image. + * Base64-encoded partial image data, suitable for rendering as an image. * */ - background: 'transparent' | 'opaque' | 'auto'; + b64_json: string; /** * The Unix timestamp when the event was created. * */ created_at: number; /** - * The output format for the requested image. + * The size of the requested image. * */ - output_format: 'png' | 'webp' | 'jpeg'; + size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** - * 0-based index for the partial image (streaming). + * The quality setting for the requested image. * */ - partial_image_index: number; + quality: 'low' | 'medium' | 'high' | 'auto'; /** - * The quality setting for the requested image. + * The background setting for the requested image. * */ - quality: 'low' | 'medium' | 'high' | 'auto'; + background: 'transparent' | 'opaque' | 'auto'; /** - * The size of the requested image. + * The output format for the requested image. * */ - size: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + output_format: 'png' | 'webp' | 'jpeg'; /** - * The type of the event. Always `image_generation.partial_image`. + * 0-based index for the partial image (streaming). * */ - type: 'image_generation.partial_image'; + partial_image_index: number; }; export type ImageGenStreamEvent = @@ -7212,44 +7212,27 @@ export type ImageGenStreamEvent = */ export type ImageGenTool = { /** - * 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). + * The type of the image generation tool. Always `image_generation`. * */ - input_image_mask?: { - /** - * File ID for the mask image. - * - */ - file_id?: string; - /** - * Base64-encoded mask image. - * - */ - image_url?: string; - }; + type: 'image_generation'; /** * The image generation model to use. Default: `gpt-image-1`. * */ model?: 'gpt-image-1'; /** - * Moderation level for the generated image. Default: `auto`. + * The quality of the generated image. One of `low`, `medium`, `high`, + * or `auto`. Default: `auto`. * */ - moderation?: 'auto' | 'low'; + quality?: 'low' | 'medium' | 'high' | 'auto'; /** - * Compression level for the output image. Default: 100. + * The size of the generated image. One of `1024x1024`, `1024x1536`, + * `1536x1024`, or `auto`. Default: `auto`. * */ - output_compression?: number; + size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; /** * The output format of the generated image. One of `png`, `webp`, or * `jpeg`. Default: `png`. @@ -7257,27 +7240,44 @@ export type ImageGenTool = { */ output_format?: 'png' | 'webp' | 'jpeg'; /** - * Number of partial images to generate in streaming mode, from 0 (default value) to 3. + * Compression level for the output image. Default: 100. * */ - partial_images?: number; + output_compression?: number; /** - * The quality of the generated image. One of `low`, `medium`, `high`, - * or `auto`. Default: `auto`. + * Moderation level for the generated image. Default: `auto`. * */ - quality?: 'low' | 'medium' | 'high' | 'auto'; + moderation?: 'auto' | 'low'; /** - * The size of the generated image. One of `1024x1024`, `1024x1536`, - * `1536x1024`, or `auto`. Default: `auto`. + * Background type for the generated image. One of `transparent`, + * `opaque`, or `auto`. Default: `auto`. * */ - size?: '1024x1024' | '1024x1536' | '1536x1024' | 'auto'; + background?: 'transparent' | 'opaque' | 'auto'; + input_fidelity?: ImageInputFidelity; /** - * The type of the image generation tool. Always `image_generation`. + * Optional mask for inpainting. Contains `image_url` + * (string, optional) and `file_id` (string, optional). * */ - type: 'image_generation'; + input_image_mask?: { + /** + * Base64-encoded mask image. + * + */ + image_url?: string; + /** + * File ID for the mask image. + * + */ + file_id?: string; + }; + /** + * Number of partial images to generate in streaming mode, from 0 (default value) to 3. + * + */ + partial_images?: number; }; /** @@ -7288,25 +7288,25 @@ export type ImageGenTool = { */ export type ImageGenToolCall = { /** - * The unique ID of the image generation call. + * The type of the image generation call. Always `image_generation_call`. * */ - id: string; + type: 'image_generation_call'; /** - * The generated image encoded in base64. + * The unique ID of the image generation call. * */ - result: string; + id: string; /** * The status of the image generation call. * */ status: 'in_progress' | 'completed' | 'generating' | 'failed'; /** - * The type of the image generation call. Always `image_generation_call`. + * The generated image encoded in base64. * */ - type: 'image_generation_call'; + result: string; }; /** @@ -7331,10 +7331,6 @@ export type ImageInputFidelity = (typeof ImageInputFidelity)[keyof typeof ImageI * The response from the image generation endpoint. */ export type ImagesResponse = { - /** - * The background parameter used for the image generation. Either `transparent` or `opaque`. - */ - background?: 'transparent' | 'opaque'; /** * The Unix timestamp (in seconds) of when the image was created. */ @@ -7344,17 +7340,21 @@ export type ImagesResponse = { */ data?: Array; /** - * The output format of the image generation. Either `png`, `webp`, or `jpeg`. + * The background parameter used for the image generation. Either `transparent` or `opaque`. */ - output_format?: 'png' | 'webp' | 'jpeg'; + background?: 'transparent' | 'opaque'; /** - * The quality of the image generated. Either `low`, `medium`, or `high`. + * The output format of the image generation. Either `png`, `webp`, or `jpeg`. */ - quality?: 'low' | 'medium' | 'high'; + 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; }; @@ -7363,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 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; }; - /** - * The number of image tokens in the output image. - */ - output_tokens: number; - /** - * The total number of tokens (images and text) used for the image generation. - * - */ - total_tokens: number; }; /** @@ -7443,6 +7443,11 @@ 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. * @@ -7454,11 +7459,6 @@ export type InputAudio = { * */ format: 'mp3' | 'wav'; - /** - * The type of the input item. Always `input_audio`. - * - */ - type: 'input_audio'; }; export type InputContent = @@ -7492,7 +7492,11 @@ export type InputItem = * */ export type InputMessage = { - 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`. * @@ -7504,11 +7508,7 @@ export type InputMessage = { * */ status?: 'in_progress' | 'completed' | 'incomplete'; - /** - * The type of the message input. Always set to `message`. - * - */ - type?: 'message'; + content: InputMessageContentList; }; /** @@ -7533,29 +7533,37 @@ export type InputMessageResource = InputMessage & { */ export type Invite = { /** - * The Unix timestamp (in seconds) of when the invite was accepted. + * The object type, which is always `organization.invite` */ - accepted_at?: number; + 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; /** - * The Unix timestamp (in seconds) of when the invite expires. + * `owner` or `reader` */ - expires_at: number; + role: 'owner' | 'reader'; /** - * The identifier, which can be referenced in API endpoints + * `accepted`,`expired`, or `pending` */ - id: string; + status: 'accepted' | 'expired' | 'pending'; /** * The Unix timestamp (in seconds) of when the invite was sent. */ invited_at: number; /** - * The object type, which is always `organization.invite` + * The Unix timestamp (in seconds) of when the invite expires. */ - object: 'organization.invite'; + 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. */ @@ -7569,43 +7577,35 @@ export type Invite = { */ role?: 'member' | 'owner'; }>; - /** - * `owner` or `reader` - */ - role: 'owner' | 'reader'; - /** - * `accepted`,`expired`, or `pending` - */ - status: 'accepted' | 'expired' | 'pending'; }; export type InviteDeleteResponse = { - deleted: boolean; - id: string; /** * 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 `has_more` property is used for pagination to indicate there are additional results. - */ - has_more?: boolean; /** * The last `invite_id` in the retrieved `list` */ last_id?: string; /** - * The object type, which is always `list` + * The `has_more` property is used for pagination to indicate there are additional results. */ - object: 'list'; + has_more?: boolean; }; export type InviteRequest = { @@ -7613,6 +7613,10 @@ export type InviteRequest = { * 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. */ @@ -7626,10 +7630,6 @@ export type InviteRequest = { */ role: 'member' | 'owner'; }>; - /** - * `owner` or `reader` - */ - role: 'reader' | 'owner'; }; /** @@ -7756,93 +7756,93 @@ export type ItemResource = * */ export 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; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ListAuditLogsResponse = { + object: 'list'; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: 'list'; + has_more: boolean; }; export type ListBatchesResponse = { data: Array; first_id?: string; - has_more: boolean; last_id?: string; + has_more: boolean; object: 'list'; }; export type ListCertificatesResponse = { data: Array; first_id?: string; - has_more: boolean; last_id?: string; + has_more: boolean; object: 'list'; }; export type ListFilesResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ListFineTuningCheckpointPermissionResponse = { data: Array; + object: 'list'; first_id?: string; - has_more: boolean; last_id?: string; - object: 'list'; + has_more: boolean; }; export type ListFineTuningJobCheckpointsResponse = { data: Array; + object: 'list'; first_id?: string; - has_more: boolean; last_id?: string; - object: 'list'; + has_more: boolean; }; export type ListFineTuningJobEventsResponse = { data: Array; - has_more: boolean; object: 'list'; + has_more: boolean; }; export type ListMessagesResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ListModelsResponse = { - data: Array; object: 'list'; + data: Array; }; export type ListPaginatedFineTuningJobsResponse = { @@ -7852,35 +7852,35 @@ export type ListPaginatedFineTuningJobsResponse = { }; export type ListRunStepsResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ListRunsResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ListVectorStoreFilesResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ListVectorStoresResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; /** @@ -7891,37 +7891,37 @@ export type ListVectorStoresResponse = { */ export type LocalShellExecAction = { /** - * The command to run. + * The type of the local shell action. Always `exec`. * */ - command: Array; + type: 'exec'; /** - * Environment variables to set for the command. + * The command to run. * */ - env: { - [key: string]: string; - }; + command: Array; /** * Optional timeout in milliseconds for the command. * */ timeout_ms?: number; /** - * The type of the local shell action. Always `exec`. + * Optional working directory to run the command in. * */ - type: 'exec'; + working_directory?: string; /** - * Optional user to run the command as. + * Environment variables to set for the command. * */ - user?: string; + env: { + [key: string]: string; + }; /** - * Optional working directory to run the command in. + * Optional user to run the command as. * */ - working_directory?: string; + user?: string; }; /** @@ -7944,27 +7944,27 @@ export type LocalShellTool = { * */ export type LocalShellToolCall = { - action: LocalShellExecAction; /** - * The unique ID of the local shell tool call generated by the model. + * The type of the local shell call. Always `local_shell_call`. * */ - call_id: string; + type: 'local_shell_call'; /** * The unique ID of the local shell call. * */ id: string; /** - * The status of the local shell call. + * The unique ID of the local shell tool call generated by the model. * */ - status: 'in_progress' | 'completed' | 'incomplete'; + call_id: string; + action: LocalShellExecAction; /** - * The type of the local shell call. Always `local_shell_call`. + * The status of the local shell call. * */ - type: 'local_shell_call'; + status: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -7974,6 +7974,11 @@ 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. * @@ -7989,11 +7994,6 @@ export type LocalShellToolCallOutput = { * */ status?: 'in_progress' | 'completed' | 'incomplete'; - /** - * The type of the local shell tool call output. Always `local_shell_call_output`. - * - */ - type: 'local_shell_call_output'; }; /** @@ -8002,20 +8002,20 @@ export type LocalShellToolCallOutput = { */ export type LogProbProperties = { /** - * The bytes that were used to generate the log probability. + * The token that was used to generate the log probability. * */ - bytes: Array; + token: string; /** * The log probability of the token. * */ logprob: number; /** - * The token that was used to generate the log probability. + * The bytes that were used to generate the log probability. * */ - token: string; + bytes: Array; }; /** @@ -8026,30 +8026,30 @@ export type LogProbProperties = { */ export type McpApprovalRequest = { /** - * A JSON string of arguments for the tool. + * The type of the item. Always `mcp_approval_request`. * */ - arguments: string; + type: 'mcp_approval_request'; /** * The unique ID of the approval request. * */ id: string; /** - * The name of the tool to run. + * The label of the MCP server making the request. * */ - name: string; + server_label: string; /** - * The label of the MCP server making the request. + * The name of the tool to run. * */ - server_label: string; + name: string; /** - * The type of the item. Always `mcp_approval_request`. + * A JSON string of arguments for the tool. * */ - type: 'mcp_approval_request'; + arguments: string; }; /** @@ -8060,30 +8060,30 @@ export type McpApprovalRequest = { */ export type McpApprovalResponse = { /** - * The ID of the approval request being answered. + * The type of the item. Always `mcp_approval_response`. * */ - approval_request_id: string; + type: 'mcp_approval_response'; /** - * Whether the request was approved. + * The unique ID of the approval response * */ - approve: boolean; + id?: string; /** - * The unique ID of the approval response + * The ID of the approval request being answered. * */ - id?: string; + approval_request_id: string; /** - * Optional reason for the decision. + * Whether the request was approved. * */ - reason?: string; + approve: boolean; /** - * The type of the item. Always `mcp_approval_response`. + * Optional reason for the decision. * */ - type: 'mcp_approval_response'; + reason?: string; }; /** @@ -8094,30 +8094,30 @@ export type McpApprovalResponse = { */ export type McpApprovalResponseResource = { /** - * The ID of the approval request being answered. + * The type of the item. Always `mcp_approval_response`. * */ - approval_request_id: string; + type: 'mcp_approval_response'; /** - * Whether the request was approved. + * The unique ID of the approval response * */ - approve: boolean; + id: string; /** - * The unique ID of the approval response + * The ID of the approval request being answered. * */ - id: string; + approval_request_id: string; /** - * Optional reason for the decision. + * Whether the request was approved. * */ - reason?: string; + approve: boolean; /** - * The type of the item. Always `mcp_approval_response`. + * Optional reason for the decision. * */ - type: 'mcp_approval_response'; + reason?: string; }; /** @@ -8128,10 +8128,10 @@ export type McpApprovalResponseResource = { */ export type McpListTools = { /** - * Error message if the server could not list tools. + * The type of the item. Always `mcp_list_tools`. * */ - error?: string; + type: 'mcp_list_tools'; /** * The unique ID of the list. * @@ -8148,10 +8148,10 @@ export type McpListTools = { */ tools: Array; /** - * The type of the item. Always `mcp_list_tools`. + * Error message if the server could not list tools. * */ - type: 'mcp_list_tools'; + error?: string; }; /** @@ -8162,12 +8162,10 @@ export type McpListTools = { */ export type McpListToolsTool = { /** - * Additional annotations about the tool. + * The name of the tool. * */ - annotations?: { - [key: string]: unknown; - }; + name: string; /** * The description of the tool. * @@ -8181,10 +8179,12 @@ export type McpListToolsTool = { [key: string]: unknown; }; /** - * The name of the tool. + * Additional annotations about the tool. * */ - name: string; + annotations?: { + [key: string]: unknown; + }; }; /** @@ -8195,6 +8195,33 @@ 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. * @@ -8209,14 +8236,6 @@ export type McpTool = { */ tool_names?: Array; }; - /** - * Optional HTTP headers to send to the MCP server. Use for authentication - * or other purposes. - * - */ - headers?: { - [key: string]: string; - }; /** * Specify which of the MCP server's tools require approval. */ @@ -8245,25 +8264,6 @@ export type McpTool = { } | 'always' | 'never'; - /** - * Optional description of the MCP server, used to provide more context. - * - */ - server_description?: string; - /** - * 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; - /** - * The type of the MCP tool. Always `mcp`. - */ - type: 'mcp'; }; /** @@ -8274,40 +8274,40 @@ export type McpTool = { */ export type McpToolCall = { /** - * A JSON string of the arguments passed to the tool. + * The type of the item. Always `mcp_call`. * */ - arguments: string; + type: 'mcp_call'; /** - * The error from the tool call, if any. + * The unique ID of the tool call. * */ - error?: string; + id: string; /** - * The unique ID of the tool call. + * The label of the MCP server running the tool. * */ - id: string; + server_label: string; /** * The name of the tool that was run. * */ name: string; /** - * The output from the tool call. + * A JSON string of the arguments passed to the tool. * */ - output?: string; + arguments: string; /** - * The label of the MCP server running the tool. + * The output from the tool call. * */ - server_label: string; + output?: string; /** - * The type of the item. Always `mcp_call`. + * The error from the tool call, if any. * */ - type: 'mcp_call'; + error?: string; }; /** @@ -8316,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: { - /** - * 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'; /** * 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'; }; - /** - * Always `image_file`. - */ - type: 'image_file'; }; /** @@ -8338,20 +8338,20 @@ export type MessageContentImageFileObject = { * References an image URL in the content of a message. */ export type MessageContentImageUrlObject = { - image_url: { - /** - * 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'; + /** + * The type of the content part. + */ + 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'; }; - /** - * The type of the content part. - */ - type: 'image_url'; }; /** @@ -8360,11 +8360,11 @@ export type MessageContentImageUrlObject = { * The refusal content generated by the assistant. */ export type MessageContentRefusalObject = { - refusal: string; /** * Always `refusal`. */ type: 'refusal'; + refusal: string; }; /** @@ -8373,7 +8373,14 @@ 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 = { - end_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. @@ -8381,14 +8388,7 @@ export type MessageContentTextAnnotationsFileCitationObject = { file_id: string; }; start_index: number; - /** - * The text in the message content that needs to be replaced. - */ - text: string; - /** - * Always `file_citation`. - */ - type: 'file_citation'; + end_index: number; }; /** @@ -8397,7 +8397,14 @@ 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 = { - end_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. @@ -8405,14 +8412,7 @@ export type MessageContentTextAnnotationsFilePathObject = { file_id: string; }; start_index: number; - /** - * The text in the message content that needs to be replaced. - */ - text: string; - /** - * Always `file_path`. - */ - type: 'file_path'; + end_index: number; }; /** @@ -8421,17 +8421,17 @@ export type MessageContentTextAnnotationsFilePathObject = { * The text content that is part of a message. */ export type MessageContentTextObject = { + /** + * Always `text`. + */ + type: 'text'; text: { - annotations: Array; /** * The data that makes up the text. */ value: string; + annotations: Array; }; - /** - * Always `text`. - */ - type: 'text'; }; /** @@ -8440,16 +8440,6 @@ export type MessageContentTextObject = { * References an image [File](https://platform.openai.com/docs/api-reference/files) in the content of a message. */ export type MessageDeltaContentImageFileObject = { - 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`. - */ - detail?: 'auto' | 'low' | 'high'; - /** - * 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; - }; /** * The index of the content part in the message. */ @@ -8458,6 +8448,16 @@ export type MessageDeltaContentImageFileObject = { * 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. + */ + 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'; + }; }; /** @@ -8466,16 +8466,6 @@ export type MessageDeltaContentImageFileObject = { * References an image URL in the content of a message. */ export type MessageDeltaContentImageUrlObject = { - image_url?: { - /** - * Specifies the detail level of the image. `low` uses fewer tokens, you can opt in to high resolution using `high`. - */ - detail?: 'auto' | 'low' | 'high'; - /** - * The URL of the image, must be a supported image types: jpeg, jpg, png, gif, webp. - */ - url?: string; - }; /** * The index of the content part in the message. */ @@ -8484,6 +8474,16 @@ export type MessageDeltaContentImageUrlObject = { * Always `image_url`. */ 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'; + }; }; /** @@ -8496,11 +8496,11 @@ export type MessageDeltaContentRefusalObject = { * The index of the refusal part in the message. */ index: number; - refusal?: string; /** * Always `refusal`. */ type: 'refusal'; + refusal?: string; }; /** @@ -8509,7 +8509,18 @@ 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 = { - end_index?: number; + /** + * 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. @@ -8520,19 +8531,8 @@ export type MessageDeltaContentTextAnnotationsFileCitationObject = { */ quote?: string; }; - /** - * The index of the annotation in the text content part. - */ - index: number; start_index?: number; - /** - * The text in the message content that needs to be replaced. - */ - text?: string; - /** - * Always `file_citation`. - */ - type: 'file_citation'; + end_index?: number; }; /** @@ -8541,26 +8541,26 @@ export type MessageDeltaContentTextAnnotationsFileCitationObject = { * A URL for the file that's generated when the assistant used the `code_interpreter` tool to generate a file. */ export type MessageDeltaContentTextAnnotationsFilePathObject = { - end_index?: number; - file_path?: { - /** - * The ID of the file that was generated. - */ - file_id?: string; - }; /** * The index of the annotation in the text content part. */ index: number; - start_index?: number; - /** - * The text in the message content that needs to be replaced. - */ - text?: string; /** * 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. + */ + file_id?: string; + }; + start_index?: number; + end_index?: number; }; /** @@ -8573,17 +8573,17 @@ export type MessageDeltaContentTextObject = { * The index of the content part in the message. */ index: number; + /** + * Always `text`. + */ + type: 'text'; text?: { - annotations?: Array; /** * The data that makes up the text. */ value?: string; + annotations?: Array; }; - /** - * Always `text`. - */ - type: 'text'; }; /** @@ -8593,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 content of the message in array of text and/or images. - */ - content?: Array; /** * 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; }; - /** - * 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'; }; /** @@ -8623,42 +8623,25 @@ export type MessageDeltaObject = { */ export type MessageObject = { /** - * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. - */ - assistant_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. - */ - file_id?: string; - /** - * The tools to add this file to. - */ - tools?: Array; - }>; - /** - * The Unix timestamp (in seconds) for when the message was completed. + * The identifier, which can be referenced in API endpoints. */ - completed_at: number; + id: string; /** - * The content of the message in array of text and/or images. + * The object type, which is always `thread.message`. */ - content: Array; + object: 'thread.message'; /** * The Unix timestamp (in seconds) for when the message was created. */ created_at: number; /** - * The identifier, which can be referenced in API endpoints. + * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. */ - id: string; + thread_id: string; /** - * The Unix timestamp (in seconds) for when the message was marked as incomplete. + * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. */ - incomplete_at: number; + status: 'in_progress' | 'incomplete' | 'completed'; /** * On an incomplete message, details about why the message is incomplete. */ @@ -8668,65 +8651,82 @@ export type MessageObject = { */ reason: 'content_filter' | 'max_tokens' | 'run_cancelled' | 'run_expired' | 'run_failed'; }; - metadata: Metadata; /** - * The object type, which is always `thread.message`. + * The Unix timestamp (in seconds) for when the message was completed. */ - object: 'thread.message'; + 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 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 content of the message in array of text and/or images. */ - run_id: string; + content: Array; /** - * The status of the message, which can be either `in_progress`, `incomplete`, or `completed`. + * If applicable, the ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) that authored this message. */ - status: 'in_progress' | 'incomplete' | 'completed'; + assistant_id: string; /** - * The [thread](https://platform.openai.com/docs/api-reference/threads) ID that this message belongs to. + * 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. */ - thread_id: string; -}; - -/** - * Text - * - * The text content that is part of a message. - */ -export type MessageRequestContentTextObject = { + run_id: string; /** - * Text content to be sent to the model + * A list of files attached to the message, and the tools they were added to. */ - text: string; - /** + 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; +}; + +/** + * Text + * + * 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 = | { - data: MessageObject; event: 'thread.message.created'; + data: MessageObject; } | { - data: MessageObject; event: 'thread.message.in_progress'; + data: MessageObject; } | { - data: MessageDeltaObject; event: 'thread.message.delta'; + data: MessageDeltaObject; } | { - data: MessageObject; event: 'thread.message.completed'; + data: MessageObject; } | { - data: MessageObject; event: 'thread.message.incomplete'; + data: MessageObject; }; /** @@ -8748,14 +8748,14 @@ export type Metadata = { * Describes an OpenAI model offering that can be used with the API. */ export type Model = { - /** - * The Unix timestamp (in seconds) when the model was created. - */ - created: number; /** * 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". */ @@ -8786,29 +8786,17 @@ export type ModelIdsShared = string | ChatModel; export type ModelResponseProperties = { metadata?: Metadata; /** - * 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; - /** - * 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). + * 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. * */ - safety_identifier?: string; - service_tier?: ServiceTier; + 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 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; /** * An alternative to sampling with temperature, called nucleus sampling, * where the model considers the results of the tokens with top_p probability @@ -8828,37 +8816,47 @@ export type ModelResponseProperties = { * @deprecated */ user?: string; -}; - -export type ModifyAssistantRequest = { /** - * The description of the assistant. The maximum length is 512 characters. + * 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). * */ - description?: string; + safety_identifier?: string; /** - * The system instructions that the assistant uses. The maximum length is 256,000 characters. + * 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). * */ - instructions?: string; - metadata?: Metadata; + 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; - reasoning_effort?: ReasoningEffort; - response_format?: AssistantsApiResponseFormatOption; /** - * 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 description of the assistant. The maximum length is 512 characters. * */ - temperature?: number; + 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. * @@ -8879,11 +8877,12 @@ export type ModifyAssistantRequest = { vector_store_ids?: Array; }; }; + metadata?: Metadata; /** - * 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`. + * 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. * */ - tools?: Array; + 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. * @@ -8891,6 +8890,7 @@ export type ModifyAssistantRequest = { * */ top_p?: number; + response_format?: AssistantsApiResponseFormatOption; }; export type ModifyCertificateRequest = { @@ -8909,7 +8909,6 @@ export type ModifyRunRequest = { }; export type ModifyThreadRequest = { - metadata?: Metadata; /** * 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. * @@ -8930,6 +8929,7 @@ export type ModifyThreadRequest = { vector_store_ids?: Array; }; }; + metadata?: Metadata; }; /** @@ -8963,6 +8963,10 @@ 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. */ @@ -8979,10 +8983,6 @@ export type OpenAiFile = { * The name of the file. */ filename: string; - /** - * The file identifier, which can be referenced in the API endpoints. - */ - id: string; /** * The object type, which is always `file`. */ @@ -9032,6 +9032,11 @@ 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. * @@ -9042,11 +9047,6 @@ export type OutputAudio = { * */ transcript: string; - /** - * The type of the output audio. Always `output_audio`. - * - */ - type: 'output_audio'; }; export type OutputContent = @@ -9106,31 +9106,31 @@ export type OutputItem = */ export type OutputMessage = { /** - * The content of the output message. + * The unique ID of the output message. * */ - content: Array; + id: string; /** - * The unique ID of the output message. + * The type of the output message. Always `message`. * */ - id: string; + type: 'message'; /** * The role of the output message. Always `assistant`. * */ role: 'assistant'; /** - * The status of the message input. One of `in_progress`, `completed`, or - * `incomplete`. Populated when input items are returned via API. + * The content of the output message. * */ - status: 'in_progress' | 'completed' | 'incomplete'; + content: Array; /** - * The type of the output message. Always `message`. + * The status of the message input. One of `in_progress`, `completed`, or + * `incomplete`. Populated when input items are returned via API. * */ - type: 'message'; + status: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -9157,6 +9157,12 @@ 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 @@ -9164,38 +9170,32 @@ export type PredictionContent = { * */ content: string | Array; - /** - * The type of the predicted content you want to provide. This type is - * currently always `content`. - * - */ - type: 'content'; }; /** * Represents an individual project. */ export type Project = { - /** - * The Unix timestamp (in seconds) of when the project was archived or `null`. - */ - archived_at?: number; - /** - * The Unix timestamp (in seconds) of when the project was created. - */ - created_at: number; /** * 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 object type, which is always `organization.project` + * The Unix timestamp (in seconds) of when the project was created. */ - object: 'organization.project'; + created_at: number; + /** + * The Unix timestamp (in seconds) of when the project was archived or `null`. + */ + archived_at?: number; /** * `active` or `archived` */ @@ -9207,51 +9207,51 @@ export type Project = { */ export type ProjectApiKey = { /** - * The Unix timestamp (in seconds) of when the API key was created - */ - created_at: number; - /** - * The identifier, which can be referenced in API endpoints + * The object type, which is always `organization.project.api_key` */ - id: string; + object: 'organization.project.api_key'; /** - * The Unix timestamp (in seconds) of when the API key was last used. + * The redacted value of the API key */ - last_used_at: number; + redacted_value: string; /** * The name of the API key */ name: string; /** - * The object type, which is always `organization.project.api_key` + * The Unix timestamp (in seconds) of when the API key was created */ - object: 'organization.project.api_key'; + 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: { - service_account?: ProjectServiceAccount; /** * `user` or `service_account` */ type?: 'user' | 'service_account'; user?: ProjectUser; + service_account?: ProjectServiceAccount; }; - /** - * The redacted value of the API key - */ - redacted_value: string; }; export type ProjectApiKeyDeleteResponse = { - deleted: boolean; - id: string; object: 'organization.project.api_key.deleted'; + id: string; + deleted: boolean; }; export type ProjectApiKeyListResponse = { + object: 'list'; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: 'list'; + has_more: boolean; }; export type ProjectCreateRequest = { @@ -9262,11 +9262,11 @@ export type ProjectCreateRequest = { }; export type ProjectListResponse = { + object: 'list'; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: 'list'; + has_more: boolean; }; /** @@ -9274,25 +9274,17 @@ export type ProjectListResponse = { */ export type ProjectRateLimit = { /** - * The maximum batch input tokens per day. Only present for relevant models. + * The object type, which is always `project.rate_limit` */ - batch_1_day_max_input_tokens?: number; + object: 'project.rate_limit'; /** * The identifier, which can be referenced in API endpoints. */ id: string; /** - * The maximum audio megabytes per minute. Only present for relevant models. - */ - max_audio_megabytes_per_1_minute?: number; - /** - * The maximum images per minute. Only present for relevant models. - */ - max_images_per_1_minute?: number; - /** - * The maximum requests per day. Only present for relevant models. + * The model this rate limit applies to. */ - max_requests_per_1_day?: number; + model: string; /** * The maximum requests per minute. */ @@ -9302,48 +9294,56 @@ export type ProjectRateLimit = { */ max_tokens_per_1_minute: number; /** - * The model this rate limit applies to. + * The maximum images per minute. Only present for relevant models. */ - model: string; + max_images_per_1_minute?: number; /** - * The object type, which is always `project.rate_limit` + * The maximum audio megabytes per minute. Only present for relevant models. */ - object: 'project.rate_limit'; + 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; - has_more: boolean; last_id: string; - object: 'list'; + has_more: boolean; }; export type ProjectRateLimitUpdateRequest = { /** - * The maximum batch input tokens per day. Only relevant for certain models. + * The maximum requests per minute. */ - batch_1_day_max_input_tokens?: number; + max_requests_per_1_minute?: number; /** - * The maximum audio megabytes per minute. Only relevant for certain models. + * The maximum tokens per minute. */ - max_audio_megabytes_per_1_minute?: number; + max_tokens_per_1_minute?: number; /** * The maximum images per minute. Only relevant for certain models. */ max_images_per_1_minute?: number; /** - * The maximum requests per day. Only relevant for certain models. + * The maximum audio megabytes per minute. Only relevant for certain models. */ - max_requests_per_1_day?: number; + max_audio_megabytes_per_1_minute?: number; /** - * The maximum requests per minute. + * The maximum requests per day. Only relevant for certain models. */ - max_requests_per_1_minute?: number; + max_requests_per_1_day?: number; /** - * The maximum tokens per minute. + * The maximum batch input tokens per day. Only relevant for certain models. */ - max_tokens_per_1_minute?: number; + batch_1_day_max_input_tokens?: number; }; /** @@ -9351,9 +9351,9 @@ export type ProjectRateLimitUpdateRequest = { */ export type ProjectServiceAccount = { /** - * The Unix timestamp (in seconds) of when the service account was created + * The object type, which is always `organization.project.service_account` */ - created_at: number; + object: 'organization.project.service_account'; /** * The identifier, which can be referenced in API endpoints */ @@ -9362,25 +9362,25 @@ export type ProjectServiceAccount = { * The name of the service account */ name: string; - /** - * The object type, which is always `organization.project.service_account` - */ - object: 'organization.project.service_account'; /** * `owner` or `member` */ role: 'owner' | 'member'; + /** + * The Unix timestamp (in seconds) of when the service account was created + */ + created_at: number; }; export type ProjectServiceAccountApiKey = { - created_at: number; - id: string; - name: 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 = { @@ -9391,29 +9391,29 @@ export type ProjectServiceAccountCreateRequest = { }; export type ProjectServiceAccountCreateResponse = { - api_key: ProjectServiceAccountApiKey; - created_at: number; + object: 'organization.project.service_account'; id: string; name: string; - object: 'organization.project.service_account'; /** * Service accounts can only have one role of type `member` */ role: 'member'; + created_at: number; + api_key: ProjectServiceAccountApiKey; }; export type ProjectServiceAccountDeleteResponse = { - deleted: boolean; - id: string; object: 'organization.project.service_account.deleted'; + id: string; + deleted: boolean; }; export type ProjectServiceAccountListResponse = { + object: 'list'; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: 'list'; + has_more: boolean; }; export type ProjectUpdateRequest = { @@ -9428,13 +9428,9 @@ export type ProjectUpdateRequest = { */ export type ProjectUser = { /** - * The Unix timestamp (in seconds) of when the project was added. - */ - added_at: number; - /** - * The email address of the user + * The object type, which is always `organization.project.user` */ - email: string; + object: 'organization.project.user'; /** * The identifier, which can be referenced in API endpoints */ @@ -9444,38 +9440,42 @@ export type ProjectUser = { */ name: string; /** - * The object type, which is always `organization.project.user` + * The email address of the user */ - object: 'organization.project.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 = { - /** - * `owner` or `member` - */ - role: 'owner' | 'member'; /** * The ID of the user. */ user_id: string; + /** + * `owner` or `member` + */ + role: 'owner' | 'member'; }; export type ProjectUserDeleteResponse = { - deleted: boolean; - id: string; object: 'organization.project.user.deleted'; + id: string; + deleted: boolean; }; export type ProjectUserListResponse = { + object: string; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: string; + has_more: boolean; }; export type ProjectUserUpdateRequest = { @@ -9495,11 +9495,11 @@ export type Prompt = { * The unique identifier of the prompt template to use. */ id: string; - variables?: ResponsePromptVariables; /** * Optional version of the prompt template. */ version?: string; + variables?: ResponsePromptVariables; }; /** @@ -9559,7 +9559,10 @@ export type RealtimeClientEventConversationItemCreate = { * Optional client-generated ID used to identify this event. */ event_id?: string; - item: RealtimeConversationItem; + /** + * 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. @@ -9569,10 +9572,7 @@ export type RealtimeClientEventConversationItemCreate = { * */ previous_item_id?: string; - /** - * The event type, must be `conversation.item.create`. - */ - type: 'conversation.item.create'; + item: RealtimeConversationItem; }; /** @@ -9587,14 +9587,14 @@ export type RealtimeClientEventConversationItemDelete = { * Optional client-generated ID used to identify this event. */ event_id?: string; - /** - * The ID of the item to delete. - */ - item_id: string; /** * The event type, must be `conversation.item.delete`. */ type: 'conversation.item.delete'; + /** + * The ID of the item to delete. + */ + item_id: string; }; /** @@ -9609,14 +9609,14 @@ export type RealtimeClientEventConversationItemRetrieve = { * Optional client-generated ID used to identify this event. */ event_id?: string; - /** - * The ID of the item to retrieve. - */ - item_id: string; /** * The event type, must be `conversation.item.retrieve`. */ type: 'conversation.item.retrieve'; + /** + * The ID of the item to retrieve. + */ + item_id: string; }; /** @@ -9634,21 +9634,14 @@ export type RealtimeClientEventConversationItemRetrieve = { * */ export type RealtimeClientEventConversationItemTruncate = { - /** - * 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; - /** - * The index of the content part to truncate. Set this to 0. - */ - content_index: 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. @@ -9656,9 +9649,16 @@ export type RealtimeClientEventConversationItemTruncate = { */ item_id: string; /** - * The event type, must be `conversation.item.truncate`. + * The index of the content part to truncate. Set this to 0. */ - type: 'conversation.item.truncate'; + 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; }; /** @@ -9675,12 +9675,6 @@ export type RealtimeClientEventConversationItemTruncate = { * */ export type RealtimeClientEventInputAudioBufferAppend = { - /** - * 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. */ @@ -9689,6 +9683,12 @@ export type RealtimeClientEventInputAudioBufferAppend = { * 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; }; /** @@ -9761,16 +9761,16 @@ 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; - /** - * The event type, must be `response.cancel`. - */ - type: 'response.cancel'; }; /** @@ -9796,11 +9796,11 @@ export type RealtimeClientEventResponseCreate = { * Optional client-generated ID used to identify this event. */ event_id?: string; - response?: RealtimeResponseCreateParams; /** * The event type, must be `response.create`. */ type: 'response.create'; + response?: RealtimeResponseCreateParams; }; /** @@ -9821,11 +9821,11 @@ export type RealtimeClientEventSessionUpdate = { * Optional client-generated ID used to identify this event. */ event_id?: string; - session: RealtimeSessionCreateRequest; /** * The event type, must be `session.update`. */ type: 'session.update'; + session: RealtimeSessionCreateRequest; }; /** @@ -9837,11 +9837,11 @@ export type RealtimeClientEventTranscriptionSessionUpdate = { * Optional client-generated ID used to identify this event. */ event_id?: string; - session: RealtimeTranscriptionSessionCreateRequest; /** * The event type, must be `transcription_session.update`. */ type: 'transcription_session.update'; + session: RealtimeTranscriptionSessionCreateRequest; }; /** @@ -9849,18 +9849,35 @@ export type RealtimeClientEventTranscriptionSessionUpdate = { */ export type RealtimeConversationItem = { /** - * The arguments of the function call (for `function_call` items). + * 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. * */ - arguments?: string; + id?: 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 type of the item (`message`, `function_call`, `function_call_output`). * */ - call_id?: string; + 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 @@ -9871,64 +9888,67 @@ export type RealtimeConversationItem = { */ content?: Array; /** - * 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. + * 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. * */ - id?: string; + call_id?: string; /** * The name of the function being called (for `function_call` items). * */ name?: string; /** - * Identifier for the API object being returned - always `realtime.item`. + * The arguments of the function call (for `function_call` items). * */ - object?: 'realtime.item'; + 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 = { /** - * The role of the message sender (`user`, `assistant`, `system`), only - * applicable for `message` items. + * 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. * */ - role?: 'user' | 'assistant' | 'system'; + id?: string; /** - * 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. + * The type of the item (`message`, `function_call`, `function_call_output`, `item_reference`). * */ - status?: 'completed' | 'incomplete' | 'in_progress'; + type?: 'message' | 'function_call' | 'function_call_output' | 'item_reference'; /** - * The type of the item (`message`, `function_call`, `function_call_output`). + * Identifier for the API object being returned - always `realtime.item`. * */ - type?: 'message' | 'function_call' | 'function_call_output'; -}; - -/** - * The item to add to the conversation. - */ -export type RealtimeConversationItemWithReference = { + object?: 'realtime.item'; /** - * The arguments of the function call (for `function_call` items). + * 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. * */ - arguments?: string; + status?: 'completed' | 'incomplete' | 'in_progress'; /** - * 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 role of the message sender (`user`, `assistant`, `system`), only + * applicable for `message` items. * */ - call_id?: string; + role?: 'user' | 'assistant' | 'system'; /** * The content of the message, applicable for `message` items. * - Message items of role `system` support only `input_text` content @@ -9939,10 +9959,15 @@ export type RealtimeConversationItemWithReference = { */ content?: Array<{ /** - * Base64-encoded audio bytes, used for `input_audio` content type. + * The content type (`input_text`, `input_audio`, `item_reference`, `text`). * */ - audio?: string; + 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 @@ -9951,112 +9976,53 @@ export type RealtimeConversationItemWithReference = { */ id?: string; /** - * The text content, used for `input_text` and `text` content types. + * Base64-encoded audio bytes, used for `input_audio` content type. * */ - text?: string; + audio?: string; /** * The transcript of the audio, used for `input_audio` content type. * */ transcript?: string; - /** - * 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. + * 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. * */ - id?: string; + call_id?: string; /** * The name of the function being called (for `function_call` items). * */ name?: string; /** - * Identifier for the API object being returned - always `realtime.item`. + * The arguments of the function call (for `function_call` items). * */ - object?: 'realtime.item'; + arguments?: string; /** * The output of the function call (for `function_call_output` items). * */ output?: string; - /** - * The role of the message sender (`user`, `assistant`, `system`), only - * applicable for `message` items. - * - */ - role?: 'user' | 'assistant' | 'system'; - /** - * 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 type of the item (`message`, `function_call`, `function_call_output`, `item_reference`). - * - */ - type?: 'message' | 'function_call' | 'function_call_output' | 'item_reference'; }; /** * The response resource. */ export type RealtimeResponse = { - /** - * 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 unique ID of the response. */ id?: string; - /** - * 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'; - metadata?: Metadata; - /** - * 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 object type, must be `realtime.response`. */ object?: 'realtime.response'; - /** - * The list of output items generated by the response. - */ - output?: Array; - /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * - */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; /** * The final status of the response (`completed`, `cancelled`, `failed`, or * `incomplete`, `in_progress`). @@ -10068,20 +10034,12 @@ export type RealtimeResponse = { */ status_details?: { /** - * A description of the error that caused the response to fail, - * populated when the `status` is `failed`. + * The type of error that caused the response to fail, corresponding + * with the `status` field (`completed`, `cancelled`, `incomplete`, + * `failed`). * */ - error?: { - /** - * Error code, if any. - */ - code?: string; - /** - * The type of error. - */ - type?: string; - }; + 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) @@ -10092,18 +10050,26 @@ export type RealtimeResponse = { */ reason?: 'turn_detected' | 'client_cancelled' | 'max_output_tokens' | 'content_filter'; /** - * The type of error that caused the response to fail, corresponding - * with the `status` field (`completed`, `cancelled`, `incomplete`, - * `failed`). + * A description of the error that caused the response to fail, + * populated when the `status` is `failed`. * */ - type?: 'completed' | 'cancelled' | 'incomplete' | 'failed'; + error?: { + /** + * The type of error. + */ + type?: string; + /** + * Error code, if any. + */ + code?: string; + }; }; /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - * + * The list of output items generated by the response. */ - temperature?: number; + 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 @@ -10112,14 +10078,28 @@ export type RealtimeResponse = { * */ 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 audio tokens used in the Response. - */ - audio_tokens?: number; /** * The number of cached tokens used in the Response. */ @@ -10128,39 +10108,36 @@ export type RealtimeResponse = { * The number of text tokens used in the Response. */ text_tokens?: number; + /** + * The number of audio tokens used in the Response. + */ + audio_tokens?: number; }; - /** - * The number of input tokens used in the Response, including text and - * audio tokens. - * - */ - input_tokens?: number; /** * Details about the output tokens used in the Response. */ output_token_details?: { - /** - * The number of audio tokens used in the Response. - */ - audio_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; }; - /** - * The number of output tokens sent in the Response, including text and - * audio tokens. - * - */ - output_tokens?: number; - /** - * The total number of tokens in the Response including input and output - * text and audio tokens. - * - */ - total_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`, @@ -10168,6 +10145,29 @@ export type RealtimeResponse = { * */ 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'; }; /** @@ -10175,22 +10175,11 @@ export type RealtimeResponse = { */ export type RealtimeResponseCreateParams = { /** - * 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'; - /** - * 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. + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. * */ - input?: Array; + 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 @@ -10208,40 +10197,30 @@ export type RealtimeResponseCreateParams = { */ instructions?: 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'; - metadata?: Metadata; - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. + * 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`. * */ - modalities?: Array<'text' | 'audio'>; + voice?: VoiceIdsShared; /** * 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; - /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`. - * - */ - tool_choice?: string; /** * 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 @@ -10250,28 +10229,49 @@ export type RealtimeResponseCreateParams = { */ description?: string; /** - * The name of the function. - */ - name?: string; - /** - * Parameters of the function in JSON Schema. + * Parameters of the function in JSON Schema. */ parameters?: { [key: string]: unknown; }; - /** - * The type of the tool, i.e. `function`. - */ - type?: 'function'; }>; /** - * 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`. + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function, like `{"type": "function", "function": {"name": "my_function"}}`. * */ - voice?: VoiceIdsShared; + 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; }; /** @@ -10387,6 +10387,14 @@ export type RealtimeServerEvent = * */ export type RealtimeServerEventConversationCreated = { + /** + * The unique ID of the server event. + */ + event_id: string; + /** + * The event type, must be `conversation.created`. + */ + type: 'conversation.created'; /** * The conversation resource. */ @@ -10400,14 +10408,6 @@ export type RealtimeServerEventConversationCreated = { */ object?: 'realtime.conversation'; }; - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `conversation.created`. - */ - type: 'conversation.created'; }; /** @@ -10427,7 +10427,10 @@ export type RealtimeServerEventConversationItemCreated = { * The unique ID of the server event. */ event_id: string; - item: RealtimeConversationItem; + /** + * 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 @@ -10435,10 +10438,7 @@ export type RealtimeServerEventConversationItemCreated = { * */ previous_item_id?: string; - /** - * The event type, must be `conversation.item.created`. - */ - type: 'conversation.item.created'; + item: RealtimeConversationItem; }; /** @@ -10452,14 +10452,14 @@ export type RealtimeServerEventConversationItemDeleted = { * The unique ID of the server event. */ event_id: string; - /** - * The ID of the item that was deleted. - */ - item_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; }; /** @@ -10476,32 +10476,32 @@ export type RealtimeServerEventConversationItemDeleted = { * */ export type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted = { - /** - * The index of the content part containing the audio. - */ - content_index: number; /** * 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 log probabilities of the transcription. + * The index of the content part containing the audio. */ - logprobs?: Array; + content_index: number; /** * The transcribed text. */ transcript: string; /** - * The event type, must be - * `conversation.item.input_audio_transcription.completed`. - * + * The log probabilities of the transcription. */ - type: 'conversation.item.input_audio_transcription.completed'; + logprobs?: Array; /** * Usage statistics for the transcription. */ @@ -10513,30 +10513,30 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionCompleted * */ export type RealtimeServerEventConversationItemInputAudioTranscriptionDelta = { - /** - * 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 `conversation.item.input_audio_transcription.delta`. + */ + type: 'conversation.item.input_audio_transcription.delta'; /** * The ID of the item. */ item_id: string; /** - * The log probabilities of the transcription. + * The index of the content part in the item's content array. */ - logprobs?: Array; + content_index?: number; /** - * The event type, must be `conversation.item.input_audio_transcription.delta`. + * The text delta. */ - type: 'conversation.item.input_audio_transcription.delta'; + delta?: string; + /** + * The log probabilities of the transcription. + */ + logprobs?: Array; }; /** @@ -10546,6 +10546,20 @@ 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`. + * + */ + 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. */ @@ -10554,6 +10568,10 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionFailed = { * Details of the transcription error. */ error: { + /** + * The type of error. + */ + type?: string; /** * Error code, if any. */ @@ -10566,25 +10584,7 @@ export type RealtimeServerEventConversationItemInputAudioTranscriptionFailed = { * Parameter related to the error, if any. */ param?: string; - /** - * The type of error. - */ - type?: string; }; - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The ID of the user message item. - */ - item_id: string; - /** - * The event type, must be - * `conversation.item.input_audio_transcription.failed`. - * - */ - type: 'conversation.item.input_audio_transcription.failed'; }; /** @@ -10596,11 +10596,11 @@ export type RealtimeServerEventConversationItemRetrieved = { * The unique ID of the server event. */ event_id: string; - item: RealtimeConversationItem; /** * The event type, must be `conversation.item.retrieved`. */ type: 'conversation.item.retrieved'; + item: RealtimeConversationItem; }; /** @@ -10613,27 +10613,27 @@ export type RealtimeServerEventConversationItemRetrieved = { * */ export type RealtimeServerEventConversationItemTruncated = { - /** - * The duration up to which the audio was truncated, in milliseconds. - * - */ - audio_end_ms: number; - /** - * The index of the content part that was truncated. - */ - content_index: number; /** * 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 event type, must be `conversation.item.truncated`. + * The index of the content part that was truncated. */ - type: 'conversation.item.truncated'; + content_index: number; + /** + * The duration up to which the audio was truncated, in milliseconds. + * + */ + audio_end_ms: number; }; /** @@ -10643,19 +10643,27 @@ 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: { /** - * Error code, if any. + * The type of error (e.g., "invalid_request_error", "server_error"). + * */ - code?: string; + type: string; /** - * The event_id of the client event that caused the error, if applicable. - * + * Error code, if any. */ - event_id?: string; + code?: string; /** * A human-readable error message. */ @@ -10665,19 +10673,11 @@ export type RealtimeServerEventError = { */ param?: string; /** - * The type of error (e.g., "invalid_request_error", "server_error"). + * The event_id of the client event that caused the error, if applicable. * */ - type: string; + event_id?: string; }; - /** - * The unique ID of the server event. - */ - event_id: string; - /** - * The event type, must be `error`. - */ - type: 'error'; }; /** @@ -10709,9 +10709,9 @@ export type RealtimeServerEventInputAudioBufferCommitted = { */ event_id: string; /** - * The ID of the user message item that will be created. + * The event type, must be `input_audio_buffer.committed`. */ - item_id: string; + 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. @@ -10719,9 +10719,9 @@ export type RealtimeServerEventInputAudioBufferCommitted = { */ previous_item_id?: string; /** - * The event type, must be `input_audio_buffer.committed`. + * The ID of the user message item that will be created. */ - type: 'input_audio_buffer.committed'; + item_id: string; }; /** @@ -10738,6 +10738,14 @@ 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 @@ -10746,19 +10754,11 @@ export type RealtimeServerEventInputAudioBufferSpeechStarted = { * */ audio_start_ms: number; - /** - * The unique ID of the server event. - */ - event_id: string; /** * The ID of the user message item that will be created when speech stops. * */ item_id: string; - /** - * The event type, must be `input_audio_buffer.speech_started`. - */ - type: 'input_audio_buffer.speech_started'; }; /** @@ -10768,6 +10768,14 @@ 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 @@ -10775,18 +10783,10 @@ export type RealtimeServerEventInputAudioBufferSpeechStopped = { * */ audio_end_ms: number; - /** - * The unique ID of the server event. - */ - event_id: string; /** * The ID of the user message item that will be created. */ item_id: string; - /** - * The event type, must be `input_audio_buffer.speech_stopped`. - */ - type: 'input_audio_buffer.speech_stopped'; }; /** @@ -10803,13 +10803,13 @@ export type RealtimeServerEventOutputAudioBufferCleared = { */ event_id: string; /** - * The unique ID of the response that produced the audio. + * The event type, must be `output_audio_buffer.cleared`. */ - response_id: string; + type: 'output_audio_buffer.cleared'; /** - * The event type, must be `output_audio_buffer.cleared`. + * The unique ID of the response that produced the audio. */ - type: 'output_audio_buffer.cleared'; + response_id: string; }; /** @@ -10824,14 +10824,14 @@ export type RealtimeServerEventOutputAudioBufferStarted = { * The unique ID of the server event. */ event_id: string; - /** - * The unique ID of the response that produced the audio. - */ - response_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; }; /** @@ -10846,14 +10846,14 @@ export type RealtimeServerEventOutputAudioBufferStopped = { * The unique ID of the server event. */ event_id: string; - /** - * The unique ID of the response that produced the audio. - */ - response_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; }; /** @@ -10868,19 +10868,23 @@ 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 maximum allowed value for the rate limit. - */ - limit?: number; /** * 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. */ @@ -10890,10 +10894,6 @@ export type RealtimeServerEventRateLimitsUpdated = { */ reset_seconds?: number; }>; - /** - * The event type, must be `rate_limits.updated`. - */ - type: 'rate_limits.updated'; }; /** @@ -10901,17 +10901,17 @@ export type RealtimeServerEventRateLimitsUpdated = { */ export type RealtimeServerEventResponseAudioDelta = { /** - * The index of the content part in the item's content array. + * The unique ID of the server event. */ - content_index: number; + event_id: string; /** - * Base64-encoded audio data delta. + * The event type, must be `response.audio.delta`. */ - delta: string; + type: 'response.audio.delta'; /** - * The unique ID of the server event. + * The ID of the response. */ - event_id: string; + response_id: string; /** * The ID of the item. */ @@ -10921,13 +10921,13 @@ export type RealtimeServerEventResponseAudioDelta = { */ output_index: number; /** - * The ID of the response. + * The index of the content part in the item's content array. */ - response_id: string; + content_index: number; /** - * The event type, must be `response.audio.delta`. + * Base64-encoded audio data delta. */ - type: 'response.audio.delta'; + delta: string; }; /** @@ -10936,14 +10936,18 @@ export type RealtimeServerEventResponseAudioDelta = { * */ export type RealtimeServerEventResponseAudioDone = { - /** - * 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. */ @@ -10953,13 +10957,9 @@ export type RealtimeServerEventResponseAudioDone = { */ output_index: number; /** - * The ID of the response. - */ - response_id: string; - /** - * The event type, must be `response.audio.done`. + * The index of the content part in the item's content array. */ - type: 'response.audio.done'; + content_index: number; }; /** @@ -10968,17 +10968,17 @@ export type RealtimeServerEventResponseAudioDone = { */ export type RealtimeServerEventResponseAudioTranscriptDelta = { /** - * The index of the content part in the item's content array. + * The unique ID of the server event. */ - content_index: number; + event_id: string; /** - * The transcript delta. + * The event type, must be `response.audio_transcript.delta`. */ - delta: string; + type: 'response.audio_transcript.delta'; /** - * The unique ID of the server event. + * The ID of the response. */ - event_id: string; + response_id: string; /** * The ID of the item. */ @@ -10988,13 +10988,13 @@ export type RealtimeServerEventResponseAudioTranscriptDelta = { */ output_index: number; /** - * The ID of the response. + * The index of the content part in the item's content array. */ - response_id: string; + content_index: number; /** - * The event type, must be `response.audio_transcript.delta`. + * The transcript delta. */ - type: 'response.audio_transcript.delta'; + delta: string; }; /** @@ -11004,14 +11004,18 @@ export type RealtimeServerEventResponseAudioTranscriptDelta = { * */ export type RealtimeServerEventResponseAudioTranscriptDone = { - /** - * 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_transcript.done`. + */ + type: 'response.audio_transcript.done'; + /** + * The ID of the response. + */ + response_id: string; /** * The ID of the item. */ @@ -11021,17 +11025,13 @@ export type RealtimeServerEventResponseAudioTranscriptDone = { */ output_index: number; /** - * The ID of the response. + * The index of the content part in the item's content array. */ - response_id: string; + content_index: number; /** * The final transcript of the audio. */ transcript: string; - /** - * The event type, must be `response.audio_transcript.done`. - */ - type: 'response.audio_transcript.done'; }; /** @@ -11040,14 +11040,18 @@ export type RealtimeServerEventResponseAudioTranscriptDone = { * */ export type RealtimeServerEventResponseContentPartAdded = { - /** - * 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.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. */ @@ -11056,35 +11060,31 @@ export type RealtimeServerEventResponseContentPartAdded = { * 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: { /** - * Base64-encoded audio data (if type is "audio"). + * The content type ("text", "audio"). */ - audio?: string; + type?: 'text' | 'audio'; /** * The text content (if type is "text"). */ text?: string; /** - * The transcript of the audio (if type is "audio"). + * Base64-encoded audio data (if type is "audio"). */ - transcript?: string; + audio?: string; /** - * The content type ("text", "audio"). + * The transcript of the audio (if type is "audio"). */ - type?: 'text' | 'audio'; + transcript?: string; }; - /** - * The ID of the response. - */ - response_id: string; - /** - * The event type, must be `response.content_part.added`. - */ - type: 'response.content_part.added'; }; /** @@ -11093,14 +11093,18 @@ export type RealtimeServerEventResponseContentPartAdded = { * */ export type RealtimeServerEventResponseContentPartDone = { - /** - * 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.content_part.done`. + */ + type: 'response.content_part.done'; + /** + * The ID of the response. + */ + response_id: string; /** * The ID of the item. */ @@ -11109,35 +11113,31 @@ export type RealtimeServerEventResponseContentPartDone = { * 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: { /** - * Base64-encoded audio data (if type is "audio"). + * The content type ("text", "audio"). */ - audio?: string; + type?: 'text' | 'audio'; /** * The text content (if type is "text"). */ text?: string; /** - * The transcript of the audio (if type is "audio"). + * Base64-encoded audio data (if type is "audio"). */ - transcript?: string; + audio?: string; /** - * The content type ("text", "audio"). + * The transcript of the audio (if type is "audio"). */ - type?: 'text' | 'audio'; + transcript?: string; }; - /** - * The ID of the response. - */ - response_id: string; - /** - * The event type, must be `response.content_part.done`. - */ - type: 'response.content_part.done'; }; /** @@ -11150,11 +11150,11 @@ export type RealtimeServerEventResponseCreated = { * The unique ID of the server event. */ event_id: string; - response: RealtimeResponse; /** * The event type, must be `response.created`. */ type: 'response.created'; + response: RealtimeResponse; }; /** @@ -11168,11 +11168,11 @@ export type RealtimeServerEventResponseDone = { * The unique ID of the server event. */ event_id: string; - response: RealtimeResponse; /** * The event type, must be `response.done`. */ type: 'response.done'; + response: RealtimeResponse; }; /** @@ -11181,17 +11181,18 @@ export type RealtimeServerEventResponseDone = { */ export type RealtimeServerEventResponseFunctionCallArgumentsDelta = { /** - * The ID of the function call. + * The unique ID of the server event. */ - call_id: string; + event_id: string; /** - * The arguments delta as a JSON string. + * The event type, must be `response.function_call_arguments.delta`. + * */ - delta: string; + type: 'response.function_call_arguments.delta'; /** - * The unique ID of the server event. + * The ID of the response. */ - event_id: string; + response_id: string; /** * The ID of the function call item. */ @@ -11201,14 +11202,13 @@ export type RealtimeServerEventResponseFunctionCallArgumentsDelta = { */ output_index: number; /** - * The ID of the response. + * The ID of the function call. */ - response_id: string; + call_id: string; /** - * The event type, must be `response.function_call_arguments.delta`. - * + * The arguments delta as a JSON string. */ - type: 'response.function_call_arguments.delta'; + delta: string; }; /** @@ -11218,17 +11218,18 @@ export type RealtimeServerEventResponseFunctionCallArgumentsDelta = { */ export type RealtimeServerEventResponseFunctionCallArgumentsDone = { /** - * The final arguments as a JSON string. + * The unique ID of the server event. */ - arguments: string; + event_id: string; /** - * The ID of the function call. + * The event type, must be `response.function_call_arguments.done`. + * */ - call_id: string; + type: 'response.function_call_arguments.done'; /** - * The unique ID of the server event. + * The ID of the response. */ - event_id: string; + response_id: string; /** * The ID of the function call item. */ @@ -11238,14 +11239,13 @@ export type RealtimeServerEventResponseFunctionCallArgumentsDone = { */ output_index: number; /** - * The ID of the response. + * The ID of the function call. */ - response_id: string; + call_id: string; /** - * The event type, must be `response.function_call_arguments.done`. - * + * The final arguments as a JSON string. */ - type: 'response.function_call_arguments.done'; + arguments: string; }; /** @@ -11256,19 +11256,19 @@ export type RealtimeServerEventResponseOutputItemAdded = { * The unique ID of the server event. */ event_id: string; - item: RealtimeConversationItem; /** - * The index of the output item in the Response. + * The event type, must be `response.output_item.added`. */ - output_index: number; + type: 'response.output_item.added'; /** * The ID of the Response to which the item belongs. */ response_id: string; /** - * The event type, must be `response.output_item.added`. + * The index of the output item in the Response. */ - type: 'response.output_item.added'; + output_index: number; + item: RealtimeConversationItem; }; /** @@ -11281,19 +11281,19 @@ export type RealtimeServerEventResponseOutputItemDone = { * The unique ID of the server event. */ event_id: string; - item: RealtimeConversationItem; /** - * The index of the output item in the Response. + * The event type, must be `response.output_item.done`. */ - output_index: number; + type: 'response.output_item.done'; /** * The ID of the Response to which the item belongs. */ response_id: string; /** - * The event type, must be `response.output_item.done`. + * The index of the output item in the Response. */ - type: 'response.output_item.done'; + output_index: number; + item: RealtimeConversationItem; }; /** @@ -11301,17 +11301,17 @@ export type RealtimeServerEventResponseOutputItemDone = { */ export type RealtimeServerEventResponseTextDelta = { /** - * The index of the content part in the item's content array. + * The unique ID of the server event. */ - content_index: number; + event_id: string; /** - * The text delta. + * The event type, must be `response.text.delta`. */ - delta: string; + type: 'response.text.delta'; /** - * The unique ID of the server event. + * The ID of the response. */ - event_id: string; + response_id: string; /** * The ID of the item. */ @@ -11321,13 +11321,13 @@ export type RealtimeServerEventResponseTextDelta = { */ output_index: number; /** - * The ID of the response. + * The index of the content part in the item's content array. */ - response_id: string; + content_index: number; /** - * The event type, must be `response.text.delta`. + * The text delta. */ - type: 'response.text.delta'; + delta: string; }; /** @@ -11336,14 +11336,18 @@ export type RealtimeServerEventResponseTextDelta = { * */ export type RealtimeServerEventResponseTextDone = { - /** - * 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.text.done`. + */ + type: 'response.text.done'; + /** + * The ID of the response. + */ + response_id: string; /** * The ID of the item. */ @@ -11353,17 +11357,13 @@ export type RealtimeServerEventResponseTextDone = { */ output_index: number; /** - * The ID of the response. + * The index of the content part in the item's content array. */ - response_id: string; + content_index: number; /** * The final text content. */ text: string; - /** - * The event type, must be `response.text.done`. - */ - type: 'response.text.done'; }; /** @@ -11377,11 +11377,11 @@ export type RealtimeServerEventSessionCreated = { * The unique ID of the server event. */ event_id: string; - session: RealtimeSession; /** * The event type, must be `session.created`. */ type: 'session.created'; + session: RealtimeSession; }; /** @@ -11394,11 +11394,11 @@ export type RealtimeServerEventSessionUpdated = { * The unique ID of the server event. */ event_id: string; - session: RealtimeSession; /** * The event type, must be `session.updated`. */ type: 'session.updated'; + session: RealtimeSession; }; /** @@ -11411,11 +11411,11 @@ export type RealtimeServerEventTranscriptionSessionUpdated = { * The unique ID of the server event. */ event_id: string; - session: RealtimeTranscriptionSessionCreateResponse; /** * The event type, must be `transcription_session.updated`. */ type: 'transcription_session.updated'; + session: RealtimeTranscriptionSessionCreateResponse; }; /** @@ -11428,51 +11428,22 @@ export type RealtimeSession = { */ id?: 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. - * - */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; - /** - * 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. + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. * */ - 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'; - }; + modalities?: unknown; /** - * 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. + * The Realtime model used for this session. * */ - input_audio_transcription?: { - /** - * 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 model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. - * - */ - model?: 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; - }; + 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 @@ -11491,30 +11462,20 @@ export type RealtimeSession = { */ instructions?: 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'; - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. + * 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`. * */ - modalities?: unknown; + voice?: VoiceIdsShared; /** - * The Realtime model used for this session. + * 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. * */ - 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'; + 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. @@ -11522,83 +11483,31 @@ export type RealtimeSession = { */ output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; /** - * 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; - /** - * 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; - /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. + * 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. * */ - tool_choice?: string; - /** - * Tools (functions) available to the model. - */ - tools?: Array<{ + input_audio_transcription?: { /** - * 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). + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - description?: string; - /** - * The name of the function. - */ - name?: string; + model?: string; /** - * Parameters of the function in JSON Schema. + * 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. + * */ - parameters?: { - [key: string]: unknown; - }; + language?: string; /** - * The type of the tool, i.e. `function`. + * 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". + * */ - type?: 'function'; - }>; - /** - * 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 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; - }; - /** - * The name of the workflow to attach to this trace. This is used to - * name the trace in the traces dashboard. - * - */ - workflow_name?: string; - }; + 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. @@ -11607,21 +11516,22 @@ export type RealtimeSession = { */ turn_detection?: { /** - * Whether or not to automatically generate a response when a VAD stop event occurs. + * Type of turn detection. * */ - create_response?: boolean; + 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'; /** - * 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. + * 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. * */ - interrupt_response?: boolean; + threshold?: number; /** * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in * milliseconds). Defaults to 300ms. @@ -11636,107 +11546,108 @@ export type RealtimeSession = { */ silence_duration_ms?: number; /** - * 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. + * Whether or not to automatically generate a response when a VAD stop event occurs. * */ - threshold?: number; + create_response?: boolean; /** - * Type of turn detection. + * 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. * */ - type?: 'server_vad' | 'semantic_vad'; + interrupt_response?: boolean; }; /** - * 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; -}; - -/** - * Realtime session object configuration. - */ -export type RealtimeSessionCreateRequest = { - /** - * Configuration options for the generated client secret. + * 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. * */ - client_secret?: { + input_audio_noise_reduction?: { /** - * Configuration for the ephemeral token expiration. + * 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. * */ - 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; - }; + type?: 'near_field' | 'far_field'; }; /** - * 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. + * 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. * */ - input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + speed?: 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. + * 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. * */ - 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'; - }; + tracing?: + | 'auto' + | { + /** + * The name of the workflow to attach to this trace. This is used to + * name the trace in the traces dashboard. + * + */ + 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; + }; + }; /** - * 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. - * + * Tools (functions) available to the model. */ - input_audio_transcription?: { + tools?: Array<{ /** - * 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. - * + * The type of the tool, i.e. `function`. */ - language?: string; + type?: 'function'; /** - * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. - * + * The name of the function. */ - model?: string; + name?: 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". + * 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). * */ - prompt?: string; - }; + description?: string; + /** + * Parameters of the function in JSON Schema. + */ + parameters?: { + [key: string]: 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. + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. * - * 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. + */ + 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. * */ - instructions?: string; + temperature?: number; /** * Maximum number of output tokens for a single assistant response, * inclusive of tool calls. Provide an integer between 1 and 4096 to @@ -11745,6 +11656,12 @@ export type RealtimeSessionCreateRequest = { * */ 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"]. @@ -11763,55 +11680,128 @@ export type RealtimeSessionCreateRequest = { | 'gpt-4o-mini-realtime-preview' | 'gpt-4o-mini-realtime-preview-2024-12-17'; /** - * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * For `pcm16`, output audio is sampled at a rate of 24kHz. + * 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. * */ - output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; + instructions?: 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. + * 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`. * */ - speed?: number; + voice?: VoiceIdsShared; /** - * 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 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. * */ - temperature?: number; + input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. + * The format of output audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. + * For `pcm16`, output audio is sampled at a rate of 24kHz. * */ - tool_choice?: string; + output_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; /** - * Tools (functions) available to the model. + * 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. + * */ - tools?: Array<{ + input_audio_transcription?: { /** - * 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). + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - description?: string; + model?: string; /** - * The name of the function. + * 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. + * */ - name?: string; + language?: string; /** - * Parameters of the function in JSON Schema. + * 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". + * */ - parameters?: { - [key: string]: 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 type of the tool, i.e. `function`. + * Type of turn detection. + * */ - type?: 'function'; - }>; + 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; + }; + /** + * 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 * @@ -11825,6 +11815,12 @@ export type RealtimeSessionCreateRequest = { tracing?: | 'auto' | { + /** + * The name of the workflow to attach to this trace. This is used to + * name the trace in the traces dashboard. + * + */ + workflow_name?: string; /** * The group id to attach to this trace to enable filtering and * grouping in the traces dashboard. @@ -11839,70 +11835,74 @@ export type RealtimeSessionCreateRequest = { metadata?: { [key: string]: unknown; }; - /** - * The name of the workflow to attach to this trace. This is used to - * name the trace in the traces dashboard. - * - */ - workflow_name?: 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. - * + * Tools (functions) available to the model. */ - turn_detection?: { - /** - * Whether or not to automatically generate a response when a VAD stop event occurs. - * - */ - create_response?: boolean; - /** - * 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'; + tools?: Array<{ /** - * 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. - * + * The type of the tool, i.e. `function`. */ - interrupt_response?: boolean; + type?: 'function'; /** - * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in - * milliseconds). Defaults to 300ms. - * + * The name of the function. */ - prefix_padding_ms?: number; + name?: string; /** - * 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. + * 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). * */ - silence_duration_ms?: number; + description?: string; /** - * 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. - * + * Parameters of the function in JSON Schema. */ - threshold?: number; + 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?: { /** - * Type of turn detection. + * Configuration for the ephemeral token expiration. * */ - type?: 'server_vad' | 'semantic_vad'; + 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; + }; }; - /** - * 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; }; /** @@ -11915,12 +11915,6 @@ export type RealtimeSessionCreateResponse = { * Ephemeral key returned by the API. */ client_secret: { - /** - * Timestamp for when the token expires. Currently, all tokens expire - * after one minute. - * - */ - expires_at: number; /** * Ephemeral key usable in client environments to authenticate connections * to the Realtime API. Use this in client-side environments rather than @@ -11928,27 +11922,19 @@ export type RealtimeSessionCreateResponse = { * */ value: string; - }; - /** - * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. - * - */ - input_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. + * Timestamp for when the token expires. Currently, all tokens expire + * after one minute. * */ - model?: string; + 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 @@ -11966,24 +11952,38 @@ export type RealtimeSessionCreateResponse = { */ instructions?: 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 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`. * */ - max_response_output_tokens?: number | 'inf'; + voice?: VoiceIdsShared; /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. + * The format of input audio. Options are `pcm16`, `g711_ulaw`, or `g711_alaw`. * */ - modalities?: unknown; + 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. + * + */ + 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 @@ -11991,43 +11991,6 @@ export type RealtimeSessionCreateResponse = { * */ speed?: number; - /** - * Sampling temperature for the model, limited to [0.6, 1.2]. Defaults to 0.8. - * - */ - temperature?: number; - /** - * How the model chooses tools. Options are `auto`, `none`, `required`, or - * specify a function. - * - */ - tool_choice?: string; - /** - * Tools (functions) available to the model. - */ - tools?: Array<{ - /** - * 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; - /** - * The name of the function. - */ - name?: string; - /** - * Parameters of the function in JSON Schema. - */ - parameters?: { - [key: string]: unknown; - }; - /** - * The type of the tool, i.e. `function`. - */ - type?: 'function'; - }>; /** * Tracing Configuration * @@ -12041,6 +12004,12 @@ export type RealtimeSessionCreateResponse = { tracing?: | 'auto' | { + /** + * The name of the workflow to attach to this trace. This is used to + * name the trace in the traces dashboard. + * + */ + workflow_name?: string; /** * The group id to attach to this trace to enable filtering and * grouping in the traces dashboard. @@ -12055,12 +12024,6 @@ export type RealtimeSessionCreateResponse = { metadata?: { [key: string]: unknown; }; - /** - * The name of the workflow to attach to this trace. This is used to - * name the trace in the traces dashboard. - * - */ - workflow_name?: string; }; /** * Configuration for turn detection. Can be set to `null` to turn off. Server @@ -12069,6 +12032,18 @@ export type RealtimeSessionCreateResponse = { * */ 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. @@ -12082,27 +12057,52 @@ export type RealtimeSessionCreateResponse = { * */ silence_duration_ms?: number; + }; + /** + * Tools (functions) available to the model. + */ + tools?: Array<{ /** - * 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. - * + * The type of the tool, i.e. `function`. */ - threshold?: number; + type?: 'function'; /** - * Type of turn detection, only `server_vad` is currently supported. + * 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). * */ - type?: string; - }; + description?: string; + /** + * Parameters of the function in JSON Schema. + */ + parameters?: { + [key: string]: unknown; + }; + }>; /** - * 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`. + * How the model chooses tools. Options are `auto`, `none`, `required`, or + * specify a function. * */ - voice?: VoiceIdsShared; + 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'; }; /** @@ -12110,33 +12110,11 @@ export type RealtimeSessionCreateResponse = { */ export type RealtimeTranscriptionSessionCreateRequest = { /** - * 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; - }; - }; - /** - * The set of items to include in the transcription. Current available items are: - * - `item.input_audio_transcription.logprobs` + * The set of modalities the model can respond with. To disable audio, + * set this to ["text"]. * */ - include?: Array; + 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, @@ -12145,23 +12123,15 @@ export type RealtimeTranscriptionSessionCreateRequest = { */ input_audio_format?: 'pcm16' | 'g711_ulaw' | 'g711_alaw'; /** - * 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. + * 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_noise_reduction?: { + input_audio_transcription?: { /** - * 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. + * The model to use for transcription, current options are `gpt-4o-transcribe`, `gpt-4o-mini-transcribe`, and `whisper-1`. * */ - type?: 'near_field' | 'far_field'; - }; - /** - * 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?: { + 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 @@ -12169,11 +12139,6 @@ export type RealtimeTranscriptionSessionCreateRequest = { * */ language?: string; - /** - * 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'; /** * An optional text to guide the model's style or continue a previous audio * segment. @@ -12183,12 +12148,6 @@ export type RealtimeTranscriptionSessionCreateRequest = { */ prompt?: string; }; - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. - * - */ - modalities?: unknown; /** * 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. @@ -12197,21 +12156,22 @@ export type RealtimeTranscriptionSessionCreateRequest = { */ turn_detection?: { /** - * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions. + * Type of turn detection. * */ - create_response?: boolean; + 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'; /** - * 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. + * 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. * */ - interrupt_response?: boolean; + threshold?: number; /** * Used only for `server_vad` mode. Amount of audio to include before the VAD detected speech (in * milliseconds). Defaults to 300ms. @@ -12226,17 +12186,57 @@ export type RealtimeTranscriptionSessionCreateRequest = { */ silence_duration_ms?: number; /** - * 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. + * Whether or not to automatically generate a response when a VAD stop event occurs. Not available for transcription sessions. * */ - threshold?: number; + create_response?: boolean; /** - * Type of turn detection. + * 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. * */ - type?: 'server_vad' | 'semantic_vad'; + 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; + }; }; }; @@ -12255,12 +12255,6 @@ export type RealtimeTranscriptionSessionCreateResponse = { * */ client_secret: { - /** - * Timestamp for when the token expires. Currently, all tokens expire - * after one minute. - * - */ - expires_at: number; /** * Ephemeral key usable in client environments to authenticate connections * to the Realtime API. Use this in client-side environments rather than @@ -12268,7 +12262,19 @@ export type RealtimeTranscriptionSessionCreateResponse = { * */ value: string; + /** + * 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`. * @@ -12279,6 +12285,11 @@ export type RealtimeTranscriptionSessionCreateResponse = { * */ 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 @@ -12286,11 +12297,6 @@ export type RealtimeTranscriptionSessionCreateResponse = { * */ language?: string; - /** - * 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'; /** * 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 @@ -12299,12 +12305,6 @@ export type RealtimeTranscriptionSessionCreateResponse = { */ prompt?: string; }; - /** - * The set of modalities the model can respond with. To disable audio, - * set this to ["text"]. - * - */ - modalities?: 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 @@ -12313,18 +12313,10 @@ export type RealtimeTranscriptionSessionCreateResponse = { */ turn_detection?: { /** - * 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. + * Type of turn detection, only `server_vad` is currently supported. * */ - silence_duration_ms?: number; + 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 @@ -12333,10 +12325,18 @@ export type RealtimeTranscriptionSessionCreateResponse = { */ threshold?: number; /** - * Type of turn detection, only `server_vad` is currently supported. + * Amount of audio to include before the VAD detected speech (in + * milliseconds). Defaults to 300ms. * */ - type?: string; + 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; }; }; @@ -12352,23 +12352,23 @@ export type RealtimeTranscriptionSessionCreateResponse = { export type Reasoning = { effort?: ReasoningEffort; /** - * **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'; + 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 */ - summary?: 'auto' | 'concise' | 'detailed'; + generate_summary?: 'auto' | 'concise' | 'detailed'; }; /** @@ -12380,10 +12380,10 @@ export type Reasoning = { * */ export const ReasoningEffort = { - HIGH: 'high', + MINIMAL: 'minimal', LOW: 'low', MEDIUM: 'medium', - MINIMAL: 'minimal', + HIGH: 'high', } as const; /** @@ -12407,59 +12407,59 @@ export type ReasoningEffort = (typeof ReasoningEffort)[keyof typeof ReasoningEff */ export type ReasoningItem = { /** - * Reasoning text content. - * - */ - content?: Array<{ - /** - * Reasoning text output from the model. - * - */ - text: string; - /** - * The type of the object. Always `reasoning_text`. - * - */ - type: 'reasoning_text'; - }>; - /** - * The encrypted content of the reasoning item - populated when a response is - * generated with `reasoning.encrypted_content` in the `include` parameter. + * The type of the object. Always `reasoning`. * */ - encrypted_content?: string; + type: 'reasoning'; /** * The unique identifier of the reasoning content. * */ id: string; /** - * The status of the item. One of `in_progress`, `completed`, or - * `incomplete`. Populated when items are returned via API. + * The encrypted content of the reasoning item - populated when a response is + * generated with `reasoning.encrypted_content` in the `include` parameter. * */ - status?: 'in_progress' | 'completed' | 'incomplete'; + 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. * */ text: string; + }>; + /** + * Reasoning text content. + * + */ + content?: Array<{ /** - * The type of the object. Always `summary_text`. + * The type of the object. Always `reasoning_text`. * */ - type: 'summary_text'; + type: 'reasoning_text'; + /** + * Reasoning text output from the model. + * + */ + text: string; }>; /** - * The type of the object. Always `reasoning`. + * The status of the item. One of `in_progress`, `completed`, or + * `incomplete`. Populated when items are returned via API. * */ - type: 'reasoning'; + status?: 'in_progress' | 'completed' | 'incomplete'; }; /** @@ -12468,16 +12468,27 @@ export type ReasoningItem = { export type Response = ModelResponseProperties & ResponseProperties & { /** - * Unix timestamp (in seconds) of when this Response was created. + * Unique identifier for this Response. * */ - created_at: number; - error: ResponseError; + id: string; /** - * Unique identifier for this Response. + * The object type of this resource - always set to `response`. * */ - id: string; + object: 'response'; + /** + * The status of the response generation. One of `completed`, `failed`, + * `in_progress`, `cancelled`, `queued`, or `incomplete`. + * + */ + status?: 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete'; + /** + * Unix timestamp (in seconds) of when this Response was created. + * + */ + created_at: number; + error: ResponseError; /** * Details about why the response is incomplete. * @@ -12488,20 +12499,6 @@ export type Response = ModelResponseProperties & */ reason?: 'max_output_tokens' | 'content_filter'; }; - /** - * 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 | Array; - /** - * The object type of this resource - always set to `response`. - * - */ - object: 'response'; /** * An array of content items generated by the model. * @@ -12514,6 +12511,15 @@ export type Response = ModelResponseProperties & * */ output: Array; + /** + * 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 | Array; /** * SDK-only convenience property that contains the aggregated text output * from all `output_text` items in the `output` array, if any are present. @@ -12521,18 +12527,12 @@ export type Response = ModelResponseProperties & * */ output_text?: string; + usage?: ResponseUsage; /** * Whether to allow the model to run tool calls in parallel. * */ parallel_tool_calls: boolean; - /** - * The status of the response generation. One of `completed`, `failed`, - * `in_progress`, `cancelled`, `queued`, or `incomplete`. - * - */ - status?: 'completed' | 'failed' | 'in_progress' | 'cancelled' | 'queued' | 'incomplete'; - usage?: ResponseUsage; }; /** @@ -12540,20 +12540,20 @@ export type Response = ModelResponseProperties & */ export type ResponseAudioDeltaEvent = { /** - * A chunk of Base64 encoded response audio bytes. + * The type of the event. Always `response.audio.delta`. * */ - delta: string; + type: 'response.audio.delta'; /** * A sequence number for this chunk of the stream response. * */ sequence_number: number; /** - * The type of the event. Always `response.audio.delta`. + * A chunk of Base64 encoded response audio bytes. * */ - type: 'response.audio.delta'; + delta: string; }; /** @@ -12561,21 +12561,26 @@ export type ResponseAudioDeltaEvent = { */ export type ResponseAudioDoneEvent = { /** - * The sequence number of the delta. + * The type of the event. Always `response.audio.done`. * */ - sequence_number: number; + type: 'response.audio.done'; /** - * The type of the event. Always `response.audio.done`. + * The sequence number of the delta. * */ - type: 'response.audio.done'; + 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. * @@ -12585,26 +12590,21 @@ export type ResponseAudioTranscriptDeltaEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always `response.audio.transcript.delta`. - * - */ - type: 'response.audio.transcript.delta'; }; /** * Emitted when the full audio transcript is completed. */ export type ResponseAudioTranscriptDoneEvent = { - /** - * 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; }; /** @@ -12612,25 +12612,25 @@ export type ResponseAudioTranscriptDoneEvent = { */ export type ResponseCodeInterpreterCallCodeDeltaEvent = { /** - * The partial code snippet being streamed by the code interpreter. + * The type of the event. Always `response.code_interpreter_call_code.delta`. */ - delta: string; + 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 index of the output item in the response for which the code is being streamed. + * The partial code snippet being streamed by the code interpreter. */ - output_index: number; + 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'; }; /** @@ -12638,25 +12638,25 @@ export type ResponseCodeInterpreterCallCodeDeltaEvent = { */ export type ResponseCodeInterpreterCallCodeDoneEvent = { /** - * The final code snippet output by the code interpreter. + * The type of the event. Always `response.code_interpreter_call_code.done`. */ - code: string; + 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 index of the output item in the response for which the code is finalized. + * The final code snippet output by the code interpreter. */ - output_index: number; + 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'; + sequence_number: number; }; /** @@ -12664,21 +12664,21 @@ export type ResponseCodeInterpreterCallCodeDoneEvent = { */ export type ResponseCodeInterpreterCallCompletedEvent = { /** - * The unique identifier of the code interpreter tool call item. + * The type of the event. Always `response.code_interpreter_call.completed`. */ - item_id: string; + 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 sequence number of this event, used to order streaming events. + * The unique identifier of the code interpreter tool call item. */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.code_interpreter_call.completed`. + * The sequence number of this event, used to order streaming events. */ - type: 'response.code_interpreter_call.completed'; + sequence_number: number; }; /** @@ -12686,21 +12686,21 @@ export type ResponseCodeInterpreterCallCompletedEvent = { */ export type ResponseCodeInterpreterCallInProgressEvent = { /** - * The unique identifier of the code interpreter tool call item. + * The type of the event. Always `response.code_interpreter_call.in_progress`. */ - item_id: string; + 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 sequence number of this event, used to order streaming events. + * The unique identifier of the code interpreter tool call item. */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.code_interpreter_call.in_progress`. + * The sequence number of this event, used to order streaming events. */ - type: 'response.code_interpreter_call.in_progress'; + sequence_number: number; }; /** @@ -12708,27 +12708,32 @@ export type ResponseCodeInterpreterCallInProgressEvent = { */ export type ResponseCodeInterpreterCallInterpretingEvent = { /** - * The unique identifier of the code interpreter tool call item. + * The type of the event. Always `response.code_interpreter_call.interpreting`. */ - item_id: string; + 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 sequence number of this event, used to order streaming events. + * The unique identifier of the code interpreter tool call item. */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.code_interpreter_call.interpreting`. + * The sequence number of this event, used to order streaming events. */ - type: 'response.code_interpreter_call.interpreting'; + 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. * @@ -12738,11 +12743,6 @@ export type ResponseCompletedEvent = { * The sequence number for this event. */ sequence_number: number; - /** - * The type of the event. Always `response.completed`. - * - */ - type: 'response.completed'; }; /** @@ -12750,10 +12750,10 @@ export type ResponseCompletedEvent = { */ export type ResponseContentPartAddedEvent = { /** - * The index of the content part that was added. + * The type of the event. Always `response.content_part.added`. * */ - content_index: number; + type: 'response.content_part.added'; /** * The ID of the output item that the content part was added to. * @@ -12764,6 +12764,11 @@ export type ResponseContentPartAddedEvent = { * */ output_index: number; + /** + * The index of the content part that was added. + * + */ + content_index: number; /** * The content part that was added. * @@ -12773,11 +12778,6 @@ export type ResponseContentPartAddedEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always `response.content_part.added`. - * - */ - type: 'response.content_part.added'; }; /** @@ -12785,10 +12785,10 @@ export type ResponseContentPartAddedEvent = { */ export type ResponseContentPartDoneEvent = { /** - * The index of the content part that is done. + * The type of the event. Always `response.content_part.done`. * */ - content_index: number; + type: 'response.content_part.done'; /** * The ID of the output item that the content part was added to. * @@ -12800,19 +12800,19 @@ export type ResponseContentPartDoneEvent = { */ output_index: number; /** - * The content part that is done. + * The index of the content part that is done. * */ - part: OutputContent; + content_index: number; /** * The sequence number of this event. */ sequence_number: number; /** - * The type of the event. Always `response.content_part.done`. + * The content part that is done. * */ - type: 'response.content_part.done'; + part: OutputContent; }; /** @@ -12820,6 +12820,11 @@ export type ResponseContentPartDoneEvent = { * */ export type ResponseCreatedEvent = { + /** + * The type of the event. Always `response.created`. + * + */ + type: 'response.created'; /** * The response that was created. * @@ -12829,11 +12834,6 @@ export type ResponseCreatedEvent = { * The sequence number for this event. */ sequence_number: number; - /** - * The type of the event. Always `response.created`. - * - */ - type: 'response.created'; }; /** @@ -12844,25 +12844,25 @@ export type ResponseCreatedEvent = { */ export type ResponseCustomToolCallInputDeltaEvent = { /** - * The incremental input data (delta) for the custom tool call. + * The event type identifier. */ - delta: string; + type: 'response.custom_tool_call_input.delta'; /** - * Unique identifier for the API item associated with this event. + * The sequence number of this event. */ - item_id: string; + sequence_number: number; /** * The index of the output this delta applies to. */ output_index: number; /** - * The sequence number of this event. + * Unique identifier for the API item associated with this event. */ - sequence_number: number; + item_id: string; /** - * The event type identifier. + * The incremental input data (delta) for the custom tool call. */ - type: 'response.custom_tool_call_input.delta'; + delta: string; }; /** @@ -12873,25 +12873,25 @@ export type ResponseCustomToolCallInputDeltaEvent = { */ export type ResponseCustomToolCallInputDoneEvent = { /** - * The complete input data for the custom tool call. + * The event type identifier. */ - input: string; + type: 'response.custom_tool_call_input.done'; /** - * Unique identifier for the API item associated with this event. + * The sequence number of this event. */ - item_id: string; + sequence_number: number; /** * The index of the output this event applies to. */ output_index: number; /** - * The sequence number of this event. + * Unique identifier for the API item associated with this event. */ - sequence_number: number; + item_id: string; /** - * The event type identifier. + * The complete input data for the custom tool call. */ - type: 'response.custom_tool_call_input.done'; + input: string; }; /** @@ -12912,24 +12912,24 @@ export type ResponseError = { * */ export const ResponseErrorCode = { - EMPTY_IMAGE_FILE: 'empty_image_file', - FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image', - IMAGE_CONTENT_POLICY_VIOLATION: 'image_content_policy_violation', - IMAGE_FILE_NOT_FOUND: 'image_file_not_found', - IMAGE_FILE_TOO_LARGE: 'image_file_too_large', - IMAGE_PARSE_ERROR: 'image_parse_error', - IMAGE_TOO_LARGE: 'image_too_large', - IMAGE_TOO_SMALL: 'image_too_small', - INVALID_BASE64_IMAGE: 'invalid_base64_image', + 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_IMAGE_MODE: 'invalid_image_mode', + INVALID_BASE64_IMAGE: 'invalid_base64_image', INVALID_IMAGE_URL: 'invalid_image_url', - INVALID_PROMPT: 'invalid_prompt', - RATE_LIMIT_EXCEEDED: 'rate_limit_exceeded', - SERVER_ERROR: 'server_error', + 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', - VECTOR_STORE_TIMEOUT: 'vector_store_timeout', + EMPTY_IMAGE_FILE: 'empty_image_file', + FAILED_TO_DOWNLOAD_IMAGE: 'failed_to_download_image', + IMAGE_FILE_NOT_FOUND: 'image_file_not_found', } as const; /** @@ -12942,6 +12942,11 @@ export type ResponseErrorCode = (typeof ResponseErrorCode)[keyof typeof Response * Emitted when an error occurs. */ export type ResponseErrorEvent = { + /** + * The type of the event. Always `error`. + * + */ + type: 'error'; /** * The error code. * @@ -12961,11 +12966,6 @@ export type ResponseErrorEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always `error`. - * - */ - type: 'error'; }; /** @@ -12974,19 +12974,19 @@ export type ResponseErrorEvent = { */ export type ResponseFailedEvent = { /** - * The response that failed. + * The type of the event. Always `response.failed`. * */ - response: Response; + type: 'response.failed'; /** * The sequence number of this event. */ sequence_number: number; /** - * The type of the event. Always `response.failed`. + * The response that failed. * */ - type: 'response.failed'; + response: Response; }; /** @@ -12994,24 +12994,24 @@ export type ResponseFailedEvent = { */ export type ResponseFileSearchCallCompletedEvent = { /** - * The ID of the output item that the file search call is initiated. + * The type of the event. Always `response.file_search_call.completed`. * */ - item_id: string; + type: 'response.file_search_call.completed'; /** * The index of the output item that the file search call is initiated. * */ output_index: number; /** - * The sequence number of this event. + * The ID of the output item that the file search call is initiated. + * */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.file_search_call.completed`. - * + * The sequence number of this event. */ - type: 'response.file_search_call.completed'; + sequence_number: number; }; /** @@ -13019,24 +13019,24 @@ export type ResponseFileSearchCallCompletedEvent = { */ export type ResponseFileSearchCallInProgressEvent = { /** - * The ID of the output item that the file search call is initiated. + * The type of the event. Always `response.file_search_call.in_progress`. * */ - item_id: string; + type: 'response.file_search_call.in_progress'; /** * The index of the output item that the file search call is initiated. * */ output_index: number; /** - * The sequence number of this event. + * The ID of the output item that the file search call is initiated. + * */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.file_search_call.in_progress`. - * + * The sequence number of this event. */ - type: 'response.file_search_call.in_progress'; + sequence_number: number; }; /** @@ -13044,24 +13044,24 @@ export type ResponseFileSearchCallInProgressEvent = { */ export type ResponseFileSearchCallSearchingEvent = { /** - * The ID of the output item that the file search call is initiated. + * The type of the event. Always `response.file_search_call.searching`. * */ - item_id: string; + type: 'response.file_search_call.searching'; /** * The index of the output item that the file search call is searching. * */ output_index: number; /** - * The sequence number of this event. + * The ID of the output item that the file search call is initiated. + * */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.file_search_call.searching`. - * + * The sequence number of this event. */ - type: 'response.file_search_call.searching'; + sequence_number: number; }; /** @@ -13088,6 +13088,10 @@ export type ResponseFormatJsonObject = { * */ export type ResponseFormatJsonSchema = { + /** + * The type of response format being defined. Always `json_schema`. + */ + type: 'json_schema'; /** * JSON schema * @@ -13118,10 +13122,6 @@ export type ResponseFormatJsonSchema = { */ strict?: boolean; }; - /** - * The type of response format being defined. Always `json_schema`. - */ - type: 'json_schema'; }; /** @@ -13156,14 +13156,14 @@ export type ResponseFormatText = { * */ export type ResponseFormatTextGrammar = { - /** - * 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; }; /** @@ -13185,10 +13185,10 @@ export type ResponseFormatTextPython = { */ export type ResponseFunctionCallArgumentsDeltaEvent = { /** - * The function-call arguments delta that is added. + * The type of the event. Always `response.function_call_arguments.delta`. * */ - delta: string; + type: 'response.function_call_arguments.delta'; /** * The ID of the output item that the function-call arguments delta is added to. * @@ -13204,20 +13204,17 @@ export type ResponseFunctionCallArgumentsDeltaEvent = { */ sequence_number: number; /** - * The type of the event. Always `response.function_call_arguments.delta`. + * The function-call arguments delta that is added. * */ - type: 'response.function_call_arguments.delta'; + delta: string; }; /** * Emitted when function-call arguments are finalized. */ export type ResponseFunctionCallArgumentsDoneEvent = { - /** - * The function-call arguments. - */ - arguments: string; + type: 'response.function_call_arguments.done'; /** * The ID of the item. */ @@ -13230,7 +13227,10 @@ export type ResponseFunctionCallArgumentsDoneEvent = { * The sequence number of this event. */ sequence_number: number; - type: 'response.function_call_arguments.done'; + /** + * The function-call arguments. + */ + arguments: string; }; /** @@ -13241,9 +13241,9 @@ export type ResponseFunctionCallArgumentsDoneEvent = { */ export type ResponseImageGenCallCompletedEvent = { /** - * The unique identifier of the image generation item being processed. + * The type of the event. Always 'response.image_generation_call.completed'. */ - item_id: string; + type: 'response.image_generation_call.completed'; /** * The index of the output item in the response's output array. */ @@ -13253,9 +13253,9 @@ export type ResponseImageGenCallCompletedEvent = { */ sequence_number: number; /** - * The type of the event. Always 'response.image_generation_call.completed'. + * The unique identifier of the image generation item being processed. */ - type: 'response.image_generation_call.completed'; + item_id: string; }; /** @@ -13266,21 +13266,21 @@ export type ResponseImageGenCallCompletedEvent = { */ export type ResponseImageGenCallGeneratingEvent = { /** - * The unique identifier of the image generation item being processed. + * The type of the event. Always 'response.image_generation_call.generating'. */ - item_id: string; + type: 'response.image_generation_call.generating'; /** * The index of the output item in the response's output array. */ output_index: number; /** - * The sequence number of the image generation item being processed. + * The unique identifier of the image generation item being processed. */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always 'response.image_generation_call.generating'. + * The sequence number of the image generation item being processed. */ - type: 'response.image_generation_call.generating'; + sequence_number: number; }; /** @@ -13291,21 +13291,21 @@ export type ResponseImageGenCallGeneratingEvent = { */ export type ResponseImageGenCallInProgressEvent = { /** - * The unique identifier of the image generation item being processed. + * The type of the event. Always 'response.image_generation_call.in_progress'. */ - item_id: string; + type: 'response.image_generation_call.in_progress'; /** * The index of the output item in the response's output array. */ output_index: number; /** - * The sequence number of the image generation item being processed. + * The unique identifier of the image generation item being processed. */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always 'response.image_generation_call.in_progress'. + * The sequence number of the image generation item being processed. */ - type: 'response.image_generation_call.in_progress'; + sequence_number: number; }; /** @@ -13316,35 +13316,40 @@ export type ResponseImageGenCallInProgressEvent = { */ export type ResponseImageGenCallPartialImageEvent = { /** - * The unique identifier of the image generation item being processed. + * The type of the event. Always 'response.image_generation_call.partial_image'. */ - item_id: string; + type: 'response.image_generation_call.partial_image'; /** * The index of the output item in the response's output array. */ output_index: number; /** - * Base64-encoded partial image data, suitable for rendering as an image. - */ - partial_image_b64: string; - /** - * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). + * The unique identifier of the image generation item being processed. */ - partial_image_index: number; + 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.partial_image'. + * 0-based index for the partial image (backend is 1-based, but this is 0-based for the user). */ - type: 'response.image_generation_call.partial_image'; + 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. * @@ -13354,11 +13359,6 @@ export type ResponseInProgressEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always `response.in_progress`. - * - */ - type: 'response.in_progress'; }; /** @@ -13366,6 +13366,11 @@ export type ResponseInProgressEvent = { * */ export type ResponseIncompleteEvent = { + /** + * The type of the event. Always `response.incomplete`. + * + */ + type: 'response.incomplete'; /** * The response that was incomplete. * @@ -13375,11 +13380,6 @@ export type ResponseIncompleteEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always `response.incomplete`. - * - */ - type: 'response.incomplete'; }; /** @@ -13387,25 +13387,25 @@ export type ResponseIncompleteEvent = { */ export type ResponseItemList = { /** - * A list of items used to generate this response. + * The type of object returned, must be `list`. */ - data: Array; + object: 'list'; /** - * The ID of the first item in the list. + * A list of items used to generate this response. */ - first_id: string; + data: Array; /** * Whether there are more items available. */ has_more: boolean; /** - * The ID of the last item in the list. + * The ID of the first item in the list. */ - last_id: string; + first_id: string; /** - * The type of object returned, must be `list`. + * The ID of the last item in the list. */ - object: 'list'; + last_id: string; }; /** @@ -13415,28 +13415,28 @@ export type ResponseItemList = { * */ export type ResponseLogProb = { + /** + * A possible text token. + */ + token: string; /** * The log probability of this token. * */ logprob: number; - /** - * A possible text token. - */ - token: string; /** * The log probability of the top 20 most likely tokens. * */ top_logprobs?: Array<{ - /** - * The log probability of this token. - */ - logprob?: number; /** * A possible text token. */ token?: string; + /** + * The log probability of this token. + */ + logprob?: number; }>; }; @@ -13448,26 +13448,26 @@ export type ResponseLogProb = { */ export type ResponseMcpCallArgumentsDeltaEvent = { /** - * A JSON string containing the partial update to the arguments for the MCP tool call. - * + * The type of the event. Always 'response.mcp_call_arguments.delta'. */ - delta: string; + 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; /** - * The index of the output item in the response's output array. + * A JSON string containing the partial update to the arguments for the MCP tool call. + * */ - output_index: number; + 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'; }; /** @@ -13478,26 +13478,26 @@ export type ResponseMcpCallArgumentsDeltaEvent = { */ export type ResponseMcpCallArgumentsDoneEvent = { /** - * A JSON string containing the finalized arguments for the MCP tool call. - * + * The type of the event. Always 'response.mcp_call_arguments.done'. */ - arguments: string; + 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; /** - * The index of the output item in the response's output array. + * A JSON string containing the finalized arguments for the MCP tool call. + * */ - output_index: number; + 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'; }; /** @@ -13507,6 +13507,10 @@ 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. */ @@ -13519,10 +13523,6 @@ export type ResponseMcpCallCompletedEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always 'response.mcp_call.completed'. - */ - type: 'response.mcp_call.completed'; }; /** @@ -13532,6 +13532,10 @@ 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. */ @@ -13544,10 +13548,6 @@ export type ResponseMcpCallFailedEvent = { * The sequence number of this event. */ sequence_number: number; - /** - * The type of the event. Always 'response.mcp_call.failed'. - */ - type: 'response.mcp_call.failed'; }; /** @@ -13558,21 +13558,21 @@ export type ResponseMcpCallFailedEvent = { */ export type ResponseMcpCallInProgressEvent = { /** - * The unique identifier of the MCP tool call item being processed. - */ - item_id: string; - /** - * The index of the output item in the response's output array. + * The type of the event. Always 'response.mcp_call.in_progress'. */ - output_index: number; + type: 'response.mcp_call.in_progress'; /** * The sequence number of this event. */ sequence_number: number; /** - * The type of the event. Always 'response.mcp_call.in_progress'. + * The index of the output item in the response's output array. */ - type: 'response.mcp_call.in_progress'; + output_index: number; + /** + * The unique identifier of the MCP tool call item being processed. + */ + item_id: string; }; /** @@ -13582,6 +13582,10 @@ 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. */ @@ -13594,10 +13598,6 @@ export type ResponseMcpListToolsCompletedEvent = { * 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'; }; /** @@ -13607,6 +13607,10 @@ 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. */ @@ -13619,10 +13623,6 @@ export type ResponseMcpListToolsFailedEvent = { * 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'; }; /** @@ -13632,6 +13632,10 @@ 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. */ @@ -13644,10 +13648,6 @@ export type ResponseMcpListToolsInProgressEvent = { * 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'; }; /** @@ -13670,10 +13670,10 @@ export type ResponseModalities = Array<'text' | 'audio'>; */ export type ResponseOutputItemAddedEvent = { /** - * The output item that was added. + * The type of the event. Always `response.output_item.added`. * */ - item: OutputItem; + type: 'response.output_item.added'; /** * The index of the output item that was added. * @@ -13685,10 +13685,10 @@ export type ResponseOutputItemAddedEvent = { */ sequence_number: number; /** - * The type of the event. Always `response.output_item.added`. + * The output item that was added. * */ - type: 'response.output_item.added'; + item: OutputItem; }; /** @@ -13696,10 +13696,10 @@ export type ResponseOutputItemAddedEvent = { */ export type ResponseOutputItemDoneEvent = { /** - * The output item that was marked done. + * The type of the event. Always `response.output_item.done`. * */ - item: OutputItem; + type: 'response.output_item.done'; /** * The index of the output item that was marked done. * @@ -13711,10 +13711,10 @@ export type ResponseOutputItemDoneEvent = { */ sequence_number: number; /** - * The type of the event. Always `response.output_item.done`. + * The output item that was marked done. * */ - type: 'response.output_item.done'; + item: OutputItem; }; /** @@ -13725,19 +13725,9 @@ export type ResponseOutputItemDoneEvent = { */ export type ResponseOutputTextAnnotationAddedEvent = { /** - * The annotation object being added. (See annotation schema for details.) - */ - annotation: { - [key: string]: unknown; - }; - /** - * The index of the annotation within the content part. - */ - annotation_index: number; - /** - * The index of the content part within the output item. + * The type of the event. Always 'response.output_text.annotation.added'. */ - content_index: number; + type: 'response.output_text.annotation.added'; /** * The unique identifier of the item to which the annotation is being added. */ @@ -13746,14 +13736,24 @@ export type ResponseOutputTextAnnotationAddedEvent = { * 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 type of the event. Always 'response.output_text.annotation.added'. + * The annotation object being added. (See annotation schema for details.) */ - type: 'response.output_text.annotation.added'; + annotation: { + [key: string]: unknown; + }; }; /** @@ -13770,38 +13770,37 @@ export type ResponsePromptVariables = { export type ResponseProperties = { /** - * Whether to run the model response in the background. - * [Learn more](https://platform.openai.com/docs/guides/background). + * 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). * */ - background?: boolean; + previous_response_id?: string; /** - * 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). + * 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. * */ - max_output_tokens?: number; + model?: ModelIdsResponses; + reasoning?: Reasoning; /** - * 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. + * Whether to run the model response in the background. + * [Learn more](https://platform.openai.com/docs/guides/background). * */ - max_tool_calls?: number; + background?: boolean; /** - * 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. + * 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). * */ - model?: ModelIdsResponses; + max_output_tokens?: number; /** - * 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). + * 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. * */ - previous_response_id?: string; - prompt?: Prompt; - reasoning?: Reasoning; + max_tool_calls?: number; /** * Configuration options for a text response from the model. Can be plain * text or structured JSON data. Learn more: @@ -13813,19 +13812,6 @@ export type ResponseProperties = { format?: TextResponseFormatConfiguration; verbosity?: Verbosity; }; - /** - * 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; /** * 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. @@ -13844,6 +13830,20 @@ export type ResponseProperties = { * */ 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 @@ -13864,6 +13864,10 @@ export type ResponseProperties = { * */ export type ResponseQueuedEvent = { + /** + * The type of the event. Always 'response.queued'. + */ + type: 'response.queued'; /** * The full response object that is queued. */ @@ -13872,16 +13876,17 @@ export type ResponseQueuedEvent = { * The sequence number for this event. */ sequence_number: number; - /** - * The type of the event. Always 'response.queued'. - */ - type: 'response.queued'; }; /** * 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. * @@ -13893,40 +13898,40 @@ export type ResponseReasoningSummaryPartAddedEvent = { */ output_index: number; /** - * The summary part that was added. + * The index of the summary part within the reasoning summary. * */ - part: { - /** - * The text of the summary part. - */ - text: string; - /** - * The type of the summary part. Always `summary_text`. - */ - type: 'summary_text'; - }; + summary_index: number; /** * The sequence number of this event. * */ sequence_number: number; /** - * The index of the summary part within the reasoning summary. - * - */ - summary_index: number; - /** - * The type of the event. Always `response.reasoning_summary_part.added`. + * The summary part that was added. * */ - type: 'response.reasoning_summary_part.added'; + part: { + /** + * The type of the summary part. Always `summary_text`. + */ + type: 'summary_text'; + /** + * The text of the summary part. + */ + 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. * @@ -13938,34 +13943,29 @@ export type ResponseReasoningSummaryPartDoneEvent = { */ output_index: number; /** - * The completed summary part. + * The index of the summary part within the reasoning summary. * */ - part: { - /** - * The text of the summary part. - */ - text: string; - /** - * The type of the summary part. Always `summary_text`. - */ - type: 'summary_text'; - }; + summary_index: number; /** * The sequence number of this event. * */ sequence_number: number; /** - * The index of the summary part within the reasoning summary. - * - */ - summary_index: number; - /** - * The type of the event. Always `response.reasoning_summary_part.done`. + * The completed summary part. * */ - type: 'response.reasoning_summary_part.done'; + part: { + /** + * The type of the summary part. Always `summary_text`. + */ + type: 'summary_text'; + /** + * The text of the summary part. + */ + text: string; + }; }; /** @@ -13973,10 +13973,10 @@ export type ResponseReasoningSummaryPartDoneEvent = { */ export type ResponseReasoningSummaryTextDeltaEvent = { /** - * The text delta that was added to the summary. + * The type of the event. Always `response.reasoning_summary_text.delta`. * */ - delta: string; + type: 'response.reasoning_summary_text.delta'; /** * The ID of the item this summary text delta is associated with. * @@ -13988,26 +13988,31 @@ export type ResponseReasoningSummaryTextDeltaEvent = { */ output_index: number; /** - * The sequence number of this event. + * The index of the summary part within the reasoning summary. * */ - sequence_number: number; + summary_index: number; /** - * The index of the summary part within the reasoning summary. + * The text delta that was added to the summary. * */ - summary_index: number; + delta: string; /** - * The type of the event. Always `response.reasoning_summary_text.delta`. + * The sequence number of this event. * */ - type: 'response.reasoning_summary_text.delta'; + 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. * @@ -14018,11 +14023,6 @@ export type ResponseReasoningSummaryTextDoneEvent = { * */ output_index: number; - /** - * The sequence number of this event. - * - */ - sequence_number: number; /** * The index of the summary part within the reasoning summary. * @@ -14034,10 +14034,10 @@ export type ResponseReasoningSummaryTextDoneEvent = { */ text: string; /** - * The type of the event. Always `response.reasoning_summary_text.done`. + * The sequence number of this event. * */ - type: 'response.reasoning_summary_text.done'; + sequence_number: number; }; /** @@ -14045,15 +14045,10 @@ export type ResponseReasoningSummaryTextDoneEvent = { */ export type ResponseReasoningTextDeltaEvent = { /** - * 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. + * The type of the event. Always `response.reasoning_text.delta`. * */ - delta: string; + type: 'response.reasoning_text.delta'; /** * The ID of the item this reasoning text delta is associated with. * @@ -14065,15 +14060,20 @@ export type ResponseReasoningTextDeltaEvent = { */ output_index: number; /** - * The sequence number of this event. + * The index of the reasoning content part this delta is associated with. * */ - sequence_number: number; + content_index: number; /** - * The type of the event. Always `response.reasoning_text.delta`. + * The text delta that was added to the reasoning content. * */ - type: 'response.reasoning_text.delta'; + delta: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** @@ -14081,10 +14081,10 @@ export type ResponseReasoningTextDeltaEvent = { */ export type ResponseReasoningTextDoneEvent = { /** - * The index of the reasoning content part. + * The type of the event. Always `response.reasoning_text.done`. * */ - content_index: number; + type: 'response.reasoning_text.done'; /** * The ID of the item this reasoning text is associated with. * @@ -14096,20 +14096,20 @@ export type ResponseReasoningTextDoneEvent = { */ output_index: number; /** - * The sequence number of this event. + * The index of the reasoning content part. * */ - sequence_number: number; + content_index: number; /** * The full text of the completed reasoning content. * */ text: string; /** - * The type of the event. Always `response.reasoning_text.done`. + * The sequence number of this event. * */ - type: 'response.reasoning_text.done'; + sequence_number: number; }; /** @@ -14117,15 +14117,10 @@ export type ResponseReasoningTextDoneEvent = { */ export type ResponseRefusalDeltaEvent = { /** - * The index of the content part that the refusal text is added to. - * - */ - content_index: number; - /** - * The refusal text that is added. + * The type of the event. Always `response.refusal.delta`. * */ - delta: string; + type: 'response.refusal.delta'; /** * The ID of the output item that the refusal text is added to. * @@ -14137,15 +14132,20 @@ export type ResponseRefusalDeltaEvent = { */ output_index: number; /** - * The sequence number of this event. + * The index of the content part that the refusal text is added to. * */ - sequence_number: number; + content_index: number; /** - * The type of the event. Always `response.refusal.delta`. + * The refusal text that is added. * */ - type: 'response.refusal.delta'; + delta: string; + /** + * The sequence number of this event. + * + */ + sequence_number: number; }; /** @@ -14153,10 +14153,10 @@ export type ResponseRefusalDeltaEvent = { */ export type ResponseRefusalDoneEvent = { /** - * The index of the content part that the refusal text is finalized. + * The type of the event. Always `response.refusal.done`. * */ - content_index: number; + type: 'response.refusal.done'; /** * The ID of the output item that the refusal text is finalized. * @@ -14167,6 +14167,11 @@ export type ResponseRefusalDoneEvent = { * */ output_index: number; + /** + * The index of the content part that the refusal text is finalized. + * + */ + content_index: number; /** * The refusal text that is finalized. * @@ -14177,11 +14182,6 @@ export type ResponseRefusalDoneEvent = { * */ sequence_number: number; - /** - * The type of the event. Always `response.refusal.done`. - * - */ - type: 'response.refusal.done'; }; export type ResponseStreamEvent = @@ -14368,39 +14368,39 @@ export type ResponseStreamOptions = { */ export type ResponseTextDeltaEvent = { /** - * The index of the content part that the text delta was added to. + * The type of the event. Always `response.output_text.delta`. * */ - content_index: number; + type: 'response.output_text.delta'; /** - * The text delta that was added. + * The ID of the output item that the text delta was added to. * */ - delta: string; + item_id: string; /** - * The ID of the output item that the text delta was added to. + * The index of the output item that the text delta was added to. * */ - item_id: string; + output_index: number; /** - * The log probabilities of the tokens in the delta. + * The index of the content part that the text delta was added to. * */ - logprobs: Array; + content_index: number; /** - * The index of the output item that the text delta was added to. + * The text delta that was added. * */ - output_index: number; + delta: string; /** * The sequence number for this event. */ sequence_number: number; /** - * The type of the event. Always `response.output_text.delta`. + * The log probabilities of the tokens in the delta. * */ - type: 'response.output_text.delta'; + logprobs: Array; }; /** @@ -14408,39 +14408,39 @@ export type ResponseTextDeltaEvent = { */ export type ResponseTextDoneEvent = { /** - * The index of the content part that the text content is finalized. + * The type of the event. Always `response.output_text.done`. * */ - content_index: number; + type: 'response.output_text.done'; /** * The ID of the output item that the text content is finalized. * */ item_id: string; - /** - * The log probabilities of the tokens in the delta. - * - */ - logprobs: Array; /** * The index of the output item that the text content is finalized. * */ output_index: number; /** - * The sequence number for this event. + * The index of the content part that the text content is finalized. + * */ - sequence_number: number; + content_index: number; /** * The text content that is finalized. * */ text: string; /** - * The type of the event. Always `response.output_text.done`. + * The sequence number for this event. + */ + sequence_number: number; + /** + * The log probabilities of the tokens in the delta. * */ - type: 'response.output_text.done'; + logprobs: Array; }; /** @@ -14488,24 +14488,24 @@ export type ResponseUsage = { */ export type ResponseWebSearchCallCompletedEvent = { /** - * Unique ID for the output item associated with the web search call. + * The type of the event. Always `response.web_search_call.completed`. * */ - item_id: string; + type: 'response.web_search_call.completed'; /** * The index of the output item that the web search call is associated with. * */ output_index: number; /** - * The sequence number of the web search call being processed. + * Unique ID for the output item associated with the web search call. + * */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.web_search_call.completed`. - * + * The sequence number of the web search call being processed. */ - type: 'response.web_search_call.completed'; + sequence_number: number; }; /** @@ -14513,24 +14513,24 @@ export type ResponseWebSearchCallCompletedEvent = { */ export type ResponseWebSearchCallInProgressEvent = { /** - * Unique ID for the output item associated with the web search call. + * The type of the event. Always `response.web_search_call.in_progress`. * */ - item_id: string; + type: 'response.web_search_call.in_progress'; /** * The index of the output item that the web search call is associated with. * */ output_index: number; /** - * The sequence number of the web search call being processed. + * Unique ID for the output item associated with the web search call. + * */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.web_search_call.in_progress`. - * + * The sequence number of the web search call being processed. */ - type: 'response.web_search_call.in_progress'; + sequence_number: number; }; /** @@ -14538,24 +14538,24 @@ export type ResponseWebSearchCallInProgressEvent = { */ export type ResponseWebSearchCallSearchingEvent = { /** - * Unique ID for the output item associated with the web search call. + * The type of the event. Always `response.web_search_call.searching`. * */ - item_id: string; + type: 'response.web_search_call.searching'; /** * The index of the output item that the web search call is associated with. * */ output_index: number; /** - * The sequence number of the web search call being processed. + * Unique ID for the output item associated with the web search call. + * */ - sequence_number: number; + item_id: string; /** - * The type of the event. Always `response.web_search_call.searching`. - * + * The sequence number of the web search call being processed. */ - type: 'response.web_search_call.searching'; + sequence_number: number; }; /** @@ -14618,37 +14618,37 @@ export type RunGraderRequest = { }; 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; - model_grader_parse_error: boolean; - model_grader_refusal_error: boolean; - model_grader_server_error: boolean; - model_grader_server_error_details: string; other_error: boolean; - python_grader_runtime_error: boolean; - python_grader_runtime_error_details: string; python_grader_server_error: boolean; python_grader_server_error_type: string; - sample_parse_error: boolean; - truncated_observation_error: boolean; - unresponsive_reward_error: boolean; + 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; - name: string; - sampled_model_name: string; scores: { [key: string]: unknown; }; token_usage: number; - type: string; + sampled_model_name: string; }; - model_grader_token_usage_per_model: { + sub_rewards: { [key: string]: unknown; }; - reward: number; - sub_rewards: { + model_grader_token_usage_per_model: { [key: string]: unknown; }; }; @@ -14660,46 +14660,44 @@ export type RunGraderResponse = { */ export type RunObject = { /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. - */ - assistant_id: string; - /** - * The Unix timestamp (in seconds) for when the run was cancelled. + * The identifier, which can be referenced in API endpoints. */ - cancelled_at: number; + id: string; /** - * The Unix timestamp (in seconds) for when the run was completed. + * The object type, which is always `thread.run`. */ - completed_at: number; + object: 'thread.run'; /** * The Unix timestamp (in seconds) for when the run was created. */ created_at: number; /** - * The Unix timestamp (in seconds) for when the run will expire. - */ - expires_at: number; - /** - * The Unix timestamp (in seconds) for when the run failed. + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. */ - failed_at: number; + thread_id: string; /** - * The identifier, which can be referenced in API endpoints. + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for execution of this run. */ - id: string; + assistant_id: string; + status: RunStatus; /** - * Details on why the run is incomplete. Will be `null` if the run is not incomplete. + * Details on the action required to continue the run. Will be `null` if no action is required. */ - incomplete_details: { + required_action: { /** - * The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. + * For now, this is always `submit_tool_outputs`. */ - reason?: 'max_completion_tokens' | 'max_prompt_tokens'; + 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 instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. - */ - instructions: string; /** * The last error associated with this run. Will be `null` if there are no errors. */ @@ -14714,68 +14712,70 @@ export type RunObject = { message: string; }; /** - * The maximum number of completion tokens specified to have been used over the course of the run. - * + * The Unix timestamp (in seconds) for when the run will expire. */ - max_completion_tokens: number; + expires_at: number; /** - * The maximum number of prompt tokens specified to have been used over the course of the run. - * + * The Unix timestamp (in seconds) for when the run was started. */ - max_prompt_tokens: number; - metadata: Metadata; + started_at: number; /** - * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. + * The Unix timestamp (in seconds) for when the run was cancelled. */ - model: string; + cancelled_at: number; /** - * The object type, which is always `thread.run`. + * The Unix timestamp (in seconds) for when the run failed. */ - object: 'thread.run'; - parallel_tool_calls: ParallelToolCalls; + failed_at: number; /** - * Details on the action required to continue the run. Will be `null` if no action is required. + * The Unix timestamp (in seconds) for when the run was completed. */ - required_action: { - /** - * Details on the tool outputs needed for this run to continue. - */ - submit_tool_outputs: { - /** - * A list of the relevant tool calls. - */ - tool_calls: Array; - }; + completed_at: number; + /** + * Details on why the run is incomplete. Will be `null` if the run is not incomplete. + */ + incomplete_details: { /** - * For now, this is always `submit_tool_outputs`. + * The reason why the run is incomplete. This will point to which specific token limit was reached over the course of the run. */ - type: 'submit_tool_outputs'; + reason?: 'max_completion_tokens' | 'max_prompt_tokens'; }; - response_format: AssistantsApiResponseFormatOption; - /** - * The Unix timestamp (in seconds) for when the run was started. - */ - started_at: number; - status: RunStatus; /** - * The sampling temperature used for this run. If not set, defaults to 1. + * The model that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. */ - temperature?: number; + model: string; /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was executed on as a part of this run. + * The instructions that the [assistant](https://platform.openai.com/docs/api-reference/assistants) used for this run. */ - thread_id: string; - tool_choice: AssistantsApiToolChoiceOption & unknown; + 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; - usage: RunCompletionUsage; + tool_choice: AssistantsApiToolChoiceOption & unknown; + parallel_tool_calls: ParallelToolCalls; + response_format: AssistantsApiResponseFormatOption; }; /** @@ -14803,7 +14803,6 @@ export type RunStepCompletionUsage = { * */ export type RunStepDeltaObject = { - delta: RunStepDeltaObjectDelta; /** * The identifier of the run step, which can be referenced in API endpoints. */ @@ -14812,6 +14811,7 @@ export type RunStepDeltaObject = { * The object type, which is always `thread.run.step.delta`. */ object: 'thread.run.step.delta'; + delta: RunStepDeltaObjectDelta; }; /** @@ -14820,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?: { /** * The ID of the message that was created by this run step. */ message_id?: string; }; - /** - * Always `message_creation`. - */ - type: 'message_creation'; }; /** @@ -14838,6 +14838,18 @@ 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. */ @@ -14858,30 +14870,12 @@ export type RunStepDeltaStepDetailsToolCallsCodeObject = { } & RunStepDeltaStepDetailsToolCallsCodeOutputImageObject) >; }; - /** - * The ID of the tool call. - */ - id?: string; - /** - * The index of the tool call in the tool calls array. - */ - index: number; - /** - * The type of tool call. This is always going to be `code_interpreter` for this type of tool call. - */ - type: 'code_interpreter'; }; /** * Code interpreter image output */ export type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject = { - image?: { - /** - * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. - */ - file_id?: string; - }; /** * The index of the output in the outputs array. */ @@ -14890,6 +14884,12 @@ export type RunStepDeltaStepDetailsToolCallsCodeOutputImageObject = { * Always `image`. */ type: 'image'; + image?: { + /** + * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. + */ + file_id?: string; + }; }; /** @@ -14902,73 +14902,73 @@ export type RunStepDeltaStepDetailsToolCallsCodeOutputLogsObject = { * The index of the output in the outputs array. */ index: number; - /** - * 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 RunStepDeltaStepDetailsToolCallsFileSearchObject = { - /** - * For now, this is always going to be an empty object. - */ - file_search: { - [key: string]: unknown; - }; - /** - * The ID of the tool call object. - */ - id?: string; /** * 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. + */ + 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 arguments passed to the function. - */ - arguments?: string; /** * 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; }; - /** - * The ID of the tool call object. - */ - id?: string; - /** - * The index of the tool call in the tool calls array. - */ - index: number; - /** - * The type of tool call. This is always going to be `function` for this type of tool call. - */ - type: 'function'; }; /** @@ -14977,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'; }; /** @@ -14994,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: { /** * The ID of the message that was created by this run step. */ message_id: string; }; - /** - * Always `message_creation`. - */ - type: 'message_creation'; }; /** @@ -15012,6 +15012,14 @@ 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. + */ + type: 'code_interpreter'; /** * The Code Interpreter tool call definition. */ @@ -15032,30 +15040,22 @@ export type RunStepDetailsToolCallsCodeObject = { } & RunStepDetailsToolCallsCodeOutputImageObject) >; }; - /** - * 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'; }; /** * Code Interpreter image output */ export type RunStepDetailsToolCallsCodeOutputImageObject = { + /** + * Always `image`. + */ + type: 'image'; image: { /** * The [file](https://platform.openai.com/docs/api-reference/files) ID of the image. */ file_id: string; }; - /** - * Always `image`. - */ - type: 'image'; }; /** @@ -15064,20 +15064,28 @@ export type RunStepDetailsToolCallsCodeOutputImageObject = { * Text output from the Code Interpreter tool call as part of a run step. */ export type RunStepDetailsToolCallsCodeOutputLogsObject = { - /** - * 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. */ @@ -15088,14 +15096,6 @@ export type RunStepDetailsToolCallsFileSearchObject = { */ results?: Array; }; - /** - * 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'; }; /** @@ -15117,19 +15117,6 @@ export type RunStepDetailsToolCallsFileSearchRankingOptionsObject = { * A result instance of the file search. */ export type RunStepDetailsToolCallsFileSearchResultObject = { - /** - * The content of the result that was found. The content is only included if requested via the include query parameter. - */ - content?: Array<{ - /** - * The text content of the file. - */ - text?: string; - /** - * The type of the content. - */ - type?: 'text'; - }>; /** * The ID of the file that result was found in. */ @@ -15142,37 +15129,50 @@ export type RunStepDetailsToolCallsFileSearchResultObject = { * 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. + */ + 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 arguments passed to the function. - */ - arguments: string; /** * 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; }; - /** - * 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'; }; /** @@ -15181,15 +15181,15 @@ export type RunStepDetailsToolCallsFunctionObject = { * 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; - /** - * Always `tool_calls`. - */ - type: 'tool_calls'; }; /** @@ -15200,33 +15200,47 @@ export type RunStepDetailsToolCallsObject = { */ export type RunStepObject = { /** - * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. - */ - assistant_id: string; - /** - * The Unix timestamp (in seconds) for when the run step was cancelled. + * The identifier of the run step, which can be referenced in API endpoints. */ - cancelled_at: number; + id: string; /** - * The Unix timestamp (in seconds) for when the run step completed. + * The object type, which is always `thread.run.step`. */ - completed_at: number; + object: 'thread.run.step'; /** * The Unix timestamp (in seconds) for when the run step was created. */ created_at: number; /** - * The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. + * The ID of the [assistant](https://platform.openai.com/docs/api-reference/assistants) associated with the run step. */ - expired_at: number; + assistant_id: string; /** - * The Unix timestamp (in seconds) for when the run step failed. + * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. */ - failed_at: number; + thread_id: string; /** - * The identifier of the run step, which can be referenced in API endpoints. + * The ID of the [run](https://platform.openai.com/docs/api-reference/runs) that this run step is a part of. */ - id: string; + 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) + | ({ + type?: 'RunStepDetailsToolCallsObject'; + } & RunStepDetailsToolCallsObject); /** * The last error associated with this run step. Will be `null` if there are no errors. */ @@ -15240,137 +15254,123 @@ export type RunStepObject = { */ message: string; }; - metadata: Metadata; - /** - * The object type, which is always `thread.run.step`. - */ - object: 'thread.run.step'; - /** - * 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 status of the run step, which can be either `in_progress`, `cancelled`, `failed`, `completed`, or `expired`. + * The Unix timestamp (in seconds) for when the run step expired. A step is considered expired if the parent run is expired. */ - status: 'in_progress' | 'cancelled' | 'failed' | 'completed' | 'expired'; + expired_at: number; /** - * The details of the run step. + * The Unix timestamp (in seconds) for when the run step was cancelled. */ - step_details: - | ({ - type?: 'RunStepDetailsMessageCreationObject'; - } & RunStepDetailsMessageCreationObject) - | ({ - type?: 'RunStepDetailsToolCallsObject'; - } & RunStepDetailsToolCallsObject); + cancelled_at: number; /** - * The ID of the [thread](https://platform.openai.com/docs/api-reference/threads) that was run. + * The Unix timestamp (in seconds) for when the run step failed. */ - thread_id: string; + failed_at: number; /** - * The type of run step, which can be either `message_creation` or `tool_calls`. + * The Unix timestamp (in seconds) for when the run step completed. */ - type: 'message_creation' | 'tool_calls'; + completed_at: number; + metadata: Metadata; usage: RunStepCompletionUsage; }; export type RunStepStreamEvent = | { - data: RunStepObject; event: 'thread.run.step.created'; + data: RunStepObject; } | { - data: RunStepObject; event: 'thread.run.step.in_progress'; + data: RunStepObject; } | { - data: RunStepDeltaObject; event: 'thread.run.step.delta'; + data: RunStepDeltaObject; } | { - data: RunStepObject; event: 'thread.run.step.completed'; + data: RunStepObject; } | { - data: RunStepObject; event: 'thread.run.step.failed'; + data: RunStepObject; } | { - data: RunStepObject; event: 'thread.run.step.cancelled'; + data: RunStepObject; } | { - data: RunStepObject; event: 'thread.run.step.expired'; + data: RunStepObject; }; export type RunStreamEvent = | { - data: RunObject; event: 'thread.run.created'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.queued'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.in_progress'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.requires_action'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.completed'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.incomplete'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.failed'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.cancelling'; + data: RunObject; } | { - data: RunObject; event: 'thread.run.cancelled'; + data: RunObject; } | { - 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. + */ + 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 arguments that the model expects you to pass to the function. - */ - arguments: string; /** * The name of the function. */ name: string; + /** + * The arguments that the model expects you to pass to the function. + */ + arguments: string; }; - /** - * 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'; }; /** @@ -15395,16 +15395,6 @@ export type Screenshot = { * */ export type Scroll = { - /** - * 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`. @@ -15421,6 +15411,16 @@ export type Scroll = { * */ y: number; + /** + * The horizontal scroll distance. + * + */ + scroll_x: number; + /** + * The vertical scroll distance. + * + */ + scroll_y: number; }; /** @@ -15437,8 +15437,8 @@ export const ServiceTier = { AUTO: 'auto', DEFAULT: 'default', FLEX: 'flex', - PRIORITY: 'priority', SCALE: 'scale', + PRIORITY: 'priority', } as const; /** @@ -15458,15 +15458,15 @@ export type ServiceTier = (typeof ServiceTier)[keyof typeof ServiceTier]; */ export type SpeechAudioDeltaEvent = { /** - * A chunk of Base64-encoded audio data. + * The type of the event. Always `speech.audio.delta`. * */ - audio: string; + type: 'speech.audio.delta'; /** - * The type of the event. Always `speech.audio.delta`. + * A chunk of Base64-encoded audio data. * */ - type: 'speech.audio.delta'; + audio: string; }; /** @@ -15499,6 +15499,10 @@ export type SpeechAudioDoneEvent = { }; 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`. * @@ -15506,10 +15510,6 @@ export type StaticChunkingStrategy = { * */ 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; }; /** @@ -15518,22 +15518,22 @@ export type StaticChunkingStrategy = { * Customize your own chunking strategy by setting chunk size and chunk overlap. */ export type StaticChunkingStrategyRequestParam = { - static: StaticChunkingStrategy; /** * Always `static`. */ type: 'static'; + static: StaticChunkingStrategy; }; /** * Static Chunking Strategy */ export type StaticChunkingStrategyResponseParam = { - static: StaticChunkingStrategy; /** * Always `static`. */ type: 'static'; + static: StaticChunkingStrategy; }; /** @@ -15546,24 +15546,24 @@ export type StaticChunkingStrategyResponseParam = { export type StopConfiguration = string | Array; export type SubmitToolOutputsRunRequest = { - /** - * 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; /** * A list of tools for which the outputs are being submitted. */ tool_outputs: Array<{ - /** - * The output of the tool call to be submitted to continue the run. - */ - output?: string; /** * 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; }>; + /** + * 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; }; /** @@ -15601,6 +15601,10 @@ 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. @@ -15623,10 +15627,6 @@ export type TextResponseFormatJsonSchema = { * */ strict?: boolean; - /** - * The type of response format being defined. Always `json_schema`. - */ - type: 'json_schema'; }; /** @@ -15635,19 +15635,18 @@ export type TextResponseFormatJsonSchema = { * Represents a thread that contains [messages](https://platform.openai.com/docs/api-reference/messages). */ export type ThreadObject = { - /** - * The Unix timestamp (in seconds) for when the thread was created. - */ - created_at: number; /** * The identifier, which can be referenced in API endpoints. */ id: string; - metadata: Metadata; /** * 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. * @@ -15668,18 +15667,19 @@ export type ThreadObject = { 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 = { - data: ThreadObject; /** * Whether to enable input audio transcription. */ enabled?: boolean; event: 'thread.created'; + data: ThreadObject; }; export type ToggleCertificatesRequest = { @@ -15726,6 +15726,10 @@ 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. * @@ -15752,10 +15756,6 @@ export type ToolChoiceAllowed = { tools: Array<{ [key: string]: unknown; }>; - /** - * Allowed tool configuration type. Always `allowed_tools`. - */ - type: 'allowed_tools'; }; /** @@ -15765,14 +15765,14 @@ export type ToolChoiceAllowed = { * */ export type ToolChoiceCustom = { - /** - * 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; }; /** @@ -15782,14 +15782,14 @@ export type ToolChoiceCustom = { * */ export type ToolChoiceFunction = { - /** - * 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; }; /** @@ -15800,19 +15800,19 @@ export type ToolChoiceFunction = { */ export type ToolChoiceMcp = { /** - * The name of the tool to call on the server. - * + * For MCP tools, the type is always `mcp`. */ - name?: string; + type: 'mcp'; /** * The label of the MCP server to use. * */ server_label: string; /** - * For MCP tools, the type is always `mcp`. + * The name of the tool to call on the server. + * */ - type: 'mcp'; + name?: string; }; /** @@ -15829,8 +15829,8 @@ export type ToolChoiceMcp = { * */ export const ToolChoiceOptions = { - AUTO: 'auto', NONE: 'none', + AUTO: 'auto', REQUIRED: 'required', } as const; @@ -15882,6 +15882,11 @@ export type ToolChoiceTypes = { * 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. * @@ -15893,63 +15898,58 @@ export type TranscriptTextDeltaEvent = { */ logprobs?: Array<{ /** - * The bytes that were used to generate the log probability. + * The token that was used to generate the log probability. * */ - bytes?: Array; + token?: string; /** * The log probability of the token. * */ logprob?: number; /** - * The token that was used to generate the log probability. + * The bytes that were used to generate the log probability. * */ - token?: string; + bytes?: Array; }>; - /** - * The type of the event. Always `transcript.text.delta`. - * - */ - type: 'transcript.text.delta'; }; /** * 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 bytes that were used to generate the log probability. + * The token that was used to generate the log probability. * */ - bytes?: Array; + token?: string; /** * The log probability of the token. * */ logprob?: number; /** - * The token that was used to generate the log probability. + * The bytes that were used to generate the log probability. * */ - token?: string; + bytes?: Array; }>; - /** - * The text that was transcribed. - * - */ - text: string; - /** - * The type of the event. Always `transcript.text.done`. - * - */ - type: 'transcript.text.done'; usage?: TranscriptTextUsageTokens; }; @@ -15959,14 +15959,14 @@ export type TranscriptTextDoneEvent = { * Usage statistics for models billed by audio input duration. */ export type TranscriptTextUsageDuration = { - /** - * Duration of the input audio in seconds. - */ - seconds: number; /** * The type of the usage object. Always `duration` for this variant. */ type: 'duration'; + /** + * Duration of the input audio in seconds. + */ + seconds: number; }; /** @@ -15975,23 +15975,27 @@ export type TranscriptTextUsageDuration = { * 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 audio tokens billed for this request. - */ - audio_tokens?: number; /** * Number of text tokens billed for this request. */ text_tokens?: number; + /** + * Number of audio tokens billed for this request. + */ + audio_tokens?: number; }; - /** - * Number of input tokens billed for this request. - */ - input_tokens: number; /** * Number of output tokens generated. */ @@ -16000,42 +16004,22 @@ export type TranscriptTextUsageTokens = { * Total number of tokens used (input + output). */ total_tokens: number; - /** - * The type of the usage object. Always `tokens` for this variant. - */ - type: 'tokens'; }; -/** - * Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. - */ -export type TranscriptionChunkingStrategy = 'auto' | VadConfig; - -export const TranscriptionInclude = { LOGPROBS: 'logprobs' } as const; - -export type TranscriptionInclude = (typeof TranscriptionInclude)[keyof typeof TranscriptionInclude]; - -export type TranscriptionSegment = { - /** - * 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; - /** - * End time of the segment in seconds. - */ - end: number; +/** + * Controls how the audio is cut into chunks. When set to `"auto"`, the server first normalizes loudness and then uses voice activity detection (VAD) to choose boundaries. `server_vad` object can be provided to tweak VAD detection parameters manually. If unset, the audio is transcribed as a single block. + */ +export type TranscriptionChunkingStrategy = 'auto' | VadConfig; + +export const TranscriptionInclude = { LOGPROBS: 'logprobs' } as const; + +export type TranscriptionInclude = (typeof TranscriptionInclude)[keyof typeof TranscriptionInclude]; + +export type TranscriptionSegment = { /** * Unique identifier of the segment. */ id: 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; /** * Seek offset of the segment. */ @@ -16045,9 +16029,9 @@ export type TranscriptionSegment = { */ start: number; /** - * Temperature parameter used for generating the segment. + * End time of the segment in seconds. */ - temperature: number; + end: number; /** * Text content of the segment. */ @@ -16056,21 +16040,37 @@ export type TranscriptionSegment = { * 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 = { /** - * End time of the word in seconds. + * The text content of the word. */ - end: number; + word: string; /** * Start time of the word in seconds. */ start: number; /** - * The text content of the word. + * End time of the word in seconds. */ - word: string; + end: number; }; /** @@ -16079,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 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; }; /** @@ -16096,17 +16096,17 @@ export type TruncationObject = { * */ export 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 = { @@ -16114,12 +16114,12 @@ export type UpdateVectorStoreFileAttributesRequest = { }; export type UpdateVectorStoreRequest = { - expires_after?: VectorStoreExpirationAfter & unknown; - metadata?: Metadata; /** * The name of the vector store. */ name?: string; + expires_after?: VectorStoreExpirationAfter & unknown; + metadata?: Metadata; }; /** @@ -16130,30 +16130,21 @@ export type UpdateVectorStoreRequest = { */ export type Upload = { /** - * The intended number of bytes to be uploaded. + * The Upload unique identifier, which can be referenced in API endpoints. */ - bytes: number; + id: string; /** * The Unix timestamp (in seconds) for when the Upload was created. */ created_at: number; - /** - * The Unix timestamp (in seconds) for when the Upload will expire. - */ - expires_at: number; - file?: OpenAiFile & unknown; /** * The name of the file to be uploaded. */ filename: string; /** - * The Upload unique identifier, which can be referenced in API endpoints. - */ - id: string; - /** - * The object type, which is always "upload". + * The intended number of bytes to be uploaded. */ - object: 'upload'; + 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. */ @@ -16162,17 +16153,26 @@ export type Upload = { * 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 = { - /** - * The certificate content in PEM format - */ - content: string; /** * An optional name for the certificate */ name?: string; + /** + * The certificate content in PEM format + */ + content: string; }; /** @@ -16182,45 +16182,37 @@ export type UploadCertificateRequest = { * */ export type UploadPart = { - /** - * The Unix timestamp (in seconds) for when the Part was created. - */ - created_at: number; /** * The upload Part unique identifier, which can be referenced in API endpoints. */ id: string; /** - * The object type, which is always `upload.part`. + * The Unix timestamp (in seconds) for when the Part was created. */ - object: 'upload.part'; + 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 = { - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; + object: 'organization.usage.audio_speeches.result'; /** * The number of characters processed. */ characters: number; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; /** * The count of requests made to the model. */ num_model_requests: number; - object: 'organization.usage.audio_speeches.result'; /** * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ @@ -16229,12 +16221,6 @@ export type UsageAudioSpeechesResult = { * When `group_by=user_id`, this field provides the user ID of the grouped usage result. */ user_id?: string; -}; - -/** - * The aggregated audio transcriptions usage details of the specific time bucket. - */ -export type UsageAudioTranscriptionsResult = { /** * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. */ @@ -16243,34 +16229,48 @@ export type UsageAudioTranscriptionsResult = { * 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; - object: 'organization.usage.audio_transcriptions.result'; /** * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ project_id?: string; - /** - * The number of seconds processed. - */ - seconds: number; /** * 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; - object: 'organization.usage.code_interpreter_sessions.result'; /** * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ @@ -16281,43 +16281,31 @@ export type UsageCodeInterpreterSessionsResult = { * The aggregated completions usage details of the specific time bucket. */ export type UsageCompletionsResult = { + object: 'organization.usage.completions.result'; /** - * 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=batch`, this field tells whether the grouped usage result is batch or not. - */ - batch?: boolean; - /** - * The aggregated number of audio input tokens used, including cached tokens. + * The aggregated number of text input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. */ - input_audio_tokens?: number; + 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 input tokens used, including cached tokens. For customers subscribe to scale tier, this includes scale tier tokens. - */ - input_tokens: number; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. + * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. */ - model?: string; + output_tokens: number; /** - * The count of requests made to the model. + * The aggregated number of audio input tokens used, including cached tokens. */ - num_model_requests: number; - object: 'organization.usage.completions.result'; + input_audio_tokens?: number; /** * The aggregated number of audio output tokens used. */ output_audio_tokens?: number; /** - * The aggregated number of text output tokens used. For customers subscribe to scale tier, this includes scale tier tokens. + * The count of requests made to the model. */ - output_tokens: number; + num_model_requests: number; /** * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ @@ -16326,29 +16314,33 @@ export type UsageCompletionsResult = { * 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 = { - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; + object: 'organization.usage.embeddings.result'; /** * The aggregated number of input tokens used. */ input_tokens: number; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; /** * The count of requests made to the model. */ num_model_requests: number; - object: 'organization.usage.embeddings.result'; /** * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ @@ -16357,68 +16349,68 @@ export type UsageEmbeddingsResult = { * 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 = { - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; + object: 'organization.usage.images.result'; /** * The number of images processed. */ images: number; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; /** * The count of requests made to the model. */ num_model_requests: number; - object: 'organization.usage.images.result'; /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. + * When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. */ - project_id?: string; + source?: string; /** * When `group_by=size`, this field provides the image size of the grouped usage result. */ size?: string; /** - * When `group_by=source`, this field provides the source of the grouped usage result, possible values are `image.generation`, `image.edit`, `image.variation`. + * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ - source?: string; + 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 = { - /** - * When `group_by=api_key_id`, this field provides the API key ID of the grouped usage result. - */ - api_key_id?: string; + object: 'organization.usage.moderations.result'; /** * The aggregated number of input tokens used. */ input_tokens: number; - /** - * When `group_by=model`, this field provides the model name of the grouped usage result. - */ - model?: string; /** * The count of requests made to the model. */ num_model_requests: number; - object: 'organization.usage.moderations.result'; /** * When `group_by=project_id`, this field provides the project ID of the grouped usage result. */ @@ -16426,19 +16418,28 @@ export type UsageModerationsResult = { /** * When `group_by=user_id`, this field provides the user ID of the grouped usage result. */ - user_id?: string; + 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'; }; export type UsageTimeBucket = { - end_time: number; object: 'bucket'; + start_time: number; + end_time: number; result: Array< | ({ object?: 'UsageCompletionsResult'; @@ -16468,7 +16469,6 @@ export type UsageTimeBucket = { object?: 'CostsResult'; } & CostsResult) >; - start_time: number; }; /** @@ -16476,14 +16476,14 @@ export type UsageTimeBucket = { */ export type UsageVectorStoresResult = { object: 'organization.usage.vector_stores.result'; - /** - * When `group_by=project_id`, this field provides the project ID of the grouped usage result. - */ - project_id?: string; /** * 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; }; /** @@ -16491,13 +16491,9 @@ export type UsageVectorStoresResult = { */ export type User = { /** - * The Unix timestamp (in seconds) of when the user was added. - */ - added_at: number; - /** - * The email address of the user + * The object type, which is always `organization.user` */ - email: string; + object: 'organization.user'; /** * The identifier, which can be referenced in API endpoints */ @@ -16507,27 +16503,31 @@ export type User = { */ name: string; /** - * The object type, which is always `organization.user` + * The email address of the user */ - object: 'organization.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 = { - deleted: boolean; - id: string; object: 'organization.user.deleted'; + id: string; + deleted: boolean; }; export type UserListResponse = { + object: 'list'; data: Array; first_id: string; - has_more: boolean; last_id: string; - object: 'list'; + has_more: boolean; }; export type UserRoleUpdateRequest = { @@ -16538,6 +16538,10 @@ export type UserRoleUpdateRequest = { }; 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). @@ -16558,10 +16562,6 @@ export type VadConfig = { * */ threshold?: number; - /** - * Must be set to `server_vad` to enable manual chunking using server side VAD. - */ - type: 'server_vad'; }; /** @@ -16618,15 +16618,31 @@ 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`. + */ + 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 where cancelled. + * The number of files that are currently being processed. */ - cancelled: number; + in_progress: number; /** * The number of files that have been processed. */ @@ -16636,48 +16652,36 @@ export type VectorStoreFileBatchObject = { */ failed: number; /** - * The number of files that are currently being processed. + * The number of files that where cancelled. */ - in_progress: number; + cancelled: number; /** * The total number of files. */ total: number; }; - /** - * 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 status of the vector store files batch, which can be either `in_progress`, `completed`, `cancelled` or `failed`. - */ - status: 'in_progress' | 'completed' | 'cancelled' | 'failed'; - /** - * 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; }; /** * 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 text content - */ - text?: string; /** * The content type (currently only `"text"`) */ type?: string; + /** + * The text content + */ + text?: string; }>; /** * Indicates if there are more content pages to fetch. @@ -16687,10 +16691,6 @@ export type VectorStoreFileContentResponse = { * The token for the next page, if any. */ next_page: string; - /** - * The object type, which is always `vector_store.file_content.page` - */ - object: 'vector_store.file_content.page'; }; /** @@ -16699,16 +16699,30 @@ export type VectorStoreFileContentResponse = { * A list of files attached to a vector store. */ export type VectorStoreFileObject = { - attributes?: VectorStoreFileAttributes; - chunking_strategy?: ChunkingStrategyResponse; + /** + * 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 identifier, which can be referenced in API endpoints. + * 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. */ - id: string; + 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. */ @@ -16722,22 +16736,8 @@ export type VectorStoreFileObject = { */ message: string; }; - /** - * The object type, which is always `vector_store.file`. - */ - object: 'vector_store.file'; - /** - * 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 total vector store usage in bytes. Note that this may be different from the original file size. - */ - usage_bytes: 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; + chunking_strategy?: ChunkingStrategyResponse; + attributes?: VectorStoreFileAttributes; }; /** @@ -16746,20 +16746,31 @@ 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; - expires_after?: VectorStoreExpirationAfter; /** - * The Unix timestamp (in seconds) for when the vector store will expire. + * The name of the vector store. */ - expires_at?: number; + 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 were cancelled. + * The number of files that are currently being processed. */ - cancelled: number; + in_progress: number; /** * The number of files that have been successfully processed. */ @@ -16769,54 +16780,47 @@ export type VectorStoreObject = { */ failed: number; /** - * The number of files that are currently being processed. + * The number of files that were cancelled. */ - in_progress: number; + cancelled: number; /** * The total number of files. */ total: number; }; /** - * The identifier, which can be referenced in API endpoints. + * 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. */ - id: string; + 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; - /** - * The name of the vector store. - */ - name: string; - /** - * The object type, which is always `vector_store`. - */ - object: 'vector_store'; - /** - * 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'; - /** - * The total number of bytes used by the files in the vector store. - */ - usage_bytes: number; }; export type VectorStoreSearchRequest = { /** - * A filter to apply based on file attributes. + * A query string for a search */ - filters?: ComparisonFilter | CompoundFilter; + 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 query string for a search + * A filter to apply based on file attributes. */ - query: string | Array; + filters?: ComparisonFilter | CompoundFilter; /** * Ranking options for search. */ @@ -16827,29 +16831,20 @@ export type VectorStoreSearchRequest = { ranker?: 'none' | 'auto' | 'default-2024-11-15'; score_threshold?: number; }; - /** - * Whether to rewrite the natural language query for vector search. - */ - rewrite_query?: boolean; }; export type VectorStoreSearchResultContentObject = { - /** - * 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 = { - attributes: VectorStoreFileAttributes; - /** - * Content chunks from the file. - */ - content: Array; /** * The ID of the vector store file. */ @@ -16862,9 +16857,19 @@ export type VectorStoreSearchResultItem = { * 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. */ @@ -16877,11 +16882,6 @@ export type VectorStoreSearchResultsPage = { * 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; }; /** @@ -16891,9 +16891,9 @@ export type VectorStoreSearchResultsPage = { * */ export const Verbosity = { - HIGH: 'high', LOW: 'low', MEDIUM: 'medium', + HIGH: 'high', } as const; /** @@ -16937,11 +16937,6 @@ export type Wait = { * */ export type WebSearchActionFind = { - /** - * The pattern or text to search for within the page. - * - */ - pattern: string; /** * The action type. * @@ -16952,6 +16947,11 @@ export type WebSearchActionFind = { * */ url: string; + /** + * The pattern or text to search for within the page. + * + */ + pattern: string; }; /** @@ -16981,15 +16981,15 @@ export type WebSearchActionOpenPage = { */ export type WebSearchActionSearch = { /** - * The search query. + * The action type. * */ - query: string; + type: 'search'; /** - * The action type. + * The search query. * */ - type: 'search'; + query: string; }; /** @@ -16998,9 +16998,9 @@ export type WebSearchActionSearch = { * */ export const WebSearchContextSize = { - HIGH: 'high', LOW: 'low', MEDIUM: 'medium', + HIGH: 'high', } as const; /** @@ -17016,11 +17016,6 @@ export type WebSearchContextSize = (typeof WebSearchContextSize)[keyof typeof We * Approximate location parameters for the search. */ export type WebSearchLocation = { - /** - * Free text input for the city of the user, e.g. `San Francisco`. - * - */ - city?: string; /** * The two-letter * [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of the user, @@ -17033,6 +17028,11 @@ export type WebSearchLocation = { * */ 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`. @@ -17049,6 +17049,21 @@ 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). @@ -17064,21 +17079,6 @@ export type WebSearchToolCall = { | ({ type?: 'WebSearchActionFind'; } & WebSearchActionFind); - /** - * The unique ID of the web search tool call. - * - */ - id: string; - /** - * The status of the web search tool call. - * - */ - status: 'in_progress' | 'searching' | 'completed' | 'failed'; - /** - * The type of the web search tool call. Always `web_search_call`. - * - */ - type: 'web_search_call'; }; /** @@ -17093,6 +17093,11 @@ export type WebhookBatchCancelled = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17104,11 +17109,6 @@ export type WebhookBatchCancelled = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17133,6 +17133,11 @@ export type WebhookBatchCompleted = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17144,11 +17149,6 @@ export type WebhookBatchCompleted = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17173,6 +17173,11 @@ export type WebhookBatchExpired = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17184,11 +17189,6 @@ export type WebhookBatchExpired = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17213,6 +17213,11 @@ export type WebhookBatchFailed = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17224,11 +17229,6 @@ export type WebhookBatchFailed = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17253,6 +17253,11 @@ export type WebhookEvalRunCanceled = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17264,11 +17269,6 @@ export type WebhookEvalRunCanceled = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17293,6 +17293,11 @@ export type WebhookEvalRunFailed = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17304,11 +17309,6 @@ export type WebhookEvalRunFailed = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17333,6 +17333,11 @@ export type WebhookEvalRunSucceeded = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17344,11 +17349,6 @@ export type WebhookEvalRunSucceeded = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17373,6 +17373,11 @@ export type WebhookFineTuningJobCancelled = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17384,11 +17389,6 @@ export type WebhookFineTuningJobCancelled = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17413,6 +17413,11 @@ export type WebhookFineTuningJobFailed = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17424,11 +17429,6 @@ export type WebhookFineTuningJobFailed = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17453,6 +17453,11 @@ export type WebhookFineTuningJobSucceeded = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17464,11 +17469,6 @@ export type WebhookFineTuningJobSucceeded = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17493,6 +17493,11 @@ export type WebhookResponseCancelled = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17504,11 +17509,6 @@ export type WebhookResponseCancelled = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17533,6 +17533,11 @@ export type WebhookResponseCompleted = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17544,11 +17549,6 @@ export type WebhookResponseCompleted = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17573,6 +17573,11 @@ export type WebhookResponseFailed = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17584,11 +17589,6 @@ export type WebhookResponseFailed = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17613,6 +17613,11 @@ export type WebhookResponseIncomplete = { * */ created_at: number; + /** + * The unique ID of the event. + * + */ + id: string; /** * Event data payload. * @@ -17624,11 +17629,6 @@ export type WebhookResponseIncomplete = { */ id: string; }; - /** - * The unique ID of the event. - * - */ - id: string; /** * The object of the event. Always `event`. * @@ -17647,14 +17647,14 @@ export type WebhookResponseIncomplete = { * A text input to the model. */ export type InputTextContent = { - /** - * 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; }; /** @@ -17664,15 +17664,15 @@ export type InputTextContent = { */ export type InputImageContent = { /** - * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. + * The type of the input item. Always `input_image`. */ - detail: 'low' | 'high' | 'auto'; - file_id?: string | null; + type: 'input_image'; image_url?: string | null; + file_id?: string | null; /** - * The type of the input item. Always `input_image`. + * The detail level of the image to be sent to the model. One of `high`, `low`, or `auto`. Defaults to `auto`. */ - type: 'input_image'; + detail: 'low' | 'high' | 'auto'; }; /** @@ -17682,23 +17682,23 @@ export type InputImageContent = { */ export type InputFileContent = { /** - * The content of the file to be sent to the model. - * + * The type of the input item. Always `input_file`. */ - file_data?: string; + type: 'input_file'; file_id?: string | null; - /** - * The URL of the file to be sent to the model. - */ - file_url?: string; /** * The name of the file to be sent to the model. */ filename?: string; /** - * The type of the input item. Always `input_file`. + * The URL of the file to be sent to the model. */ - type: 'input_file'; + file_url?: string; + /** + * The content of the file to be sent to the model. + * + */ + file_data?: string; }; /** @@ -17707,19 +17707,19 @@ 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 = { - description?: string | 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; - /** - * The type of the function tool. Always `function`. - */ - type: 'function'; }; export type RankingOptions = { @@ -17741,15 +17741,6 @@ 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 = { - filters?: Filters | null; - /** - * 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; /** * The type of the file search tool. Always `file_search`. */ @@ -17758,17 +17749,26 @@ export type FileSearchTool = { * 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 = { - city?: string | null; - country?: string | null; - region?: 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; }; /** @@ -17777,15 +17777,15 @@ 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 = { - /** - * 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'; }; /** @@ -17795,21 +17795,21 @@ export type WebSearchPreviewTool = { */ export type ComputerUsePreviewTool = { /** - * The height of the computer display. - */ - display_height: number; - /** - * The width of the computer display. + * The type of the computer use tool. Always `computer_use_preview`. */ - display_width: number; + type: 'computer_use_preview'; /** * The type of computer environment to control. */ environment: 'windows' | 'mac' | 'linux' | 'ubuntu' | 'browser'; /** - * The type of the computer use tool. Always `computer_use_preview`. + * The width of the computer display. */ - type: 'computer_use_preview'; + display_width: number; + /** + * The height of the computer display. + */ + display_height: number; }; /** @@ -17818,14 +17818,14 @@ export type ComputerUsePreviewTool = { * The input tokens detailed information for the image generation. */ export type ImageGenInputUsageDetails = { - /** - * 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; }; /** @@ -17838,15 +17838,15 @@ export type ImageGenUsage = { * The number of tokens (images and text) in the input prompt. */ input_tokens: number; - input_tokens_details: ImageGenInputUsageDetails; - /** - * The number of output tokens generated by the model. - */ - output_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; }; /** @@ -17856,21 +17856,21 @@ export type ImageGenUsage = { */ export type FileCitationBody = { /** - * The ID of the file. + * The type of the file citation. Always `file_citation`. */ - file_id: string; + type: 'file_citation'; /** - * The filename of the file cited. + * The ID of the file. */ - filename: string; + file_id: string; /** * The index of the file in the list of files. */ index: number; /** - * The type of the file citation. Always `file_citation`. + * The filename of the file cited. */ - type: 'file_citation'; + filename: string; }; /** @@ -17880,25 +17880,25 @@ export type FileCitationBody = { */ export type UrlCitationBody = { /** - * The index of the last character of the URL citation in the message. + * The type of the URL citation. Always `url_citation`. */ - end_index: number; + type: 'url_citation'; /** - * The index of the first character of the URL citation in the message. + * The URL of the web resource. */ - start_index: number; + url: string; /** - * The title of the web resource. + * The index of the first character of the URL citation in the message. */ - title: string; + start_index: number; /** - * The type of the URL citation. Always `url_citation`. + * The index of the last character of the URL citation in the message. */ - type: 'url_citation'; + end_index: number; /** - * The URL of the web resource. + * The title of the web resource. */ - url: string; + title: string; }; /** @@ -17908,29 +17908,29 @@ export type UrlCitationBody = { */ export type ContainerFileCitationBody = { /** - * The ID of the container file. + * The type of the container file citation. Always `container_file_citation`. */ - container_id: string; + type: 'container_file_citation'; /** - * The index of the last character of the container file citation in the message. + * The ID of the container file. */ - end_index: number; + container_id: string; /** * The ID of the file. */ file_id: string; - /** - * The filename of the container file cited. - */ - filename: string; /** * The index of the first character of the container file citation in the message. */ start_index: number; /** - * The type of the container file citation. Always `container_file_citation`. + * The index of the last character of the container file citation in the message. */ - type: 'container_file_citation'; + end_index: number; + /** + * The filename of the container file cited. + */ + filename: string; }; export type Annotation = @@ -17953,9 +17953,9 @@ export type Annotation = * The top log probability of a token. */ export type TopLogProb = { - bytes: Array; - logprob: number; token: string; + logprob: number; + bytes: Array; }; /** @@ -17964,9 +17964,9 @@ export type TopLogProb = { * The log probability of a token. */ export type LogProb = { - bytes: Array; - logprob: number; token: string; + logprob: number; + bytes: Array; top_logprobs: Array; }; @@ -17977,18 +17977,18 @@ export type LogProb = { */ export type OutputTextContent = { /** - * The annotations of the text output. + * The type of the output text. Always `output_text`. */ - annotations: Array; - logprobs?: Array; + type: 'output_text'; /** * The text output from the model. */ text: string; /** - * The type of the output text. Always `output_text`. + * The annotations of the text output. */ - type: 'output_text'; + annotations: Array; + logprobs?: Array; }; /** @@ -17997,25 +17997,25 @@ export type OutputTextContent = { * A refusal from the model. */ export type RefusalContent = { - /** - * 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 = { - code?: string | null; /** * The ID of the pending safety check. */ id: string; + code?: string | null; message?: string | null; }; @@ -18025,18 +18025,18 @@ export type ComputerCallSafetyCheckParam = { * The output of a computer tool call. */ export type ComputerCallOutputItemParam = { - acknowledged_safety_checks?: Array | null; + id?: string | null; /** * The ID of the computer tool call that produced the output. */ call_id: string; - id?: string | null; - output: ComputerScreenshotImage; - status?: 'in_progress' | 'completed' | 'incomplete' | null; /** * 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; }; /** @@ -18045,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; - id?: string | null; + /** + * 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; - /** - * The type of the function tool call output. Always `function_call_output`. - */ - type: 'function_call_output'; }; /** @@ -18067,19 +18067,24 @@ 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; }; export type RealtimeConversationItemContent = { /** - * Base64-encoded audio bytes, used for `input_audio` content type. + * The content type (`input_text`, `input_audio`, `item_reference`, `text`, `audio`). * */ - audio?: string; + 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 @@ -18088,21 +18093,16 @@ export type RealtimeConversationItemContent = { */ id?: string; /** - * The text content, used for `input_text` and `text` content types. + * Base64-encoded audio bytes, used for `input_audio` content type. * */ - text?: string; + 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'; }; export type RealtimeConnectParams = { @@ -18113,6 +18113,10 @@ export type RealtimeConnectParams = { * 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. */ @@ -18122,24 +18126,20 @@ export type ModerationImageUrlInput = { */ url: string; }; - /** - * Always `image_url`. - */ - type: 'image_url'; }; /** * An object describing text to classify. */ export type ModerationTextInput = { - /** - * A string of text to classify. - */ - text: string; /** * Always `text`. */ type: 'text'; + /** + * A string of text to classify. + */ + text: string; }; /** @@ -18160,10 +18160,10 @@ export type ChunkingStrategyResponse = export const FilePurpose = { ASSISTANTS: 'assistants', BATCH: 'batch', - EVALS: 'evals', FINE_TUNE: 'fine-tune', - USER_DATA: 'user_data', VISION: 'vision', + USER_DATA: 'user_data', + EVALS: 'evals', } as const; /** @@ -18177,10 +18177,6 @@ export type BatchError = { * An error code identifying the error type. */ code?: string; - /** - * The line number of the input file where the error occurred, if applicable. - */ - line?: number; /** * A human-readable message providing more details about the error. */ @@ -18189,12 +18185,20 @@ export type BatchError = { * 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. */ @@ -18203,10 +18207,6 @@ export type BatchRequestCounts = { * Number of requests that have failed. */ failed: number; - /** - * Total number of requests in the batch. - */ - total: number; }; export type AssistantTool = @@ -18287,68 +18287,68 @@ export type MessageContentDelta = } & MessageDeltaContentImageUrlObject); export const ChatModel = { - GPT_4_1: 'gpt-4.1', - GPT_4_1_2025_04_14: 'gpt-4.1-2025-04-14', - GPT_4_1_MINI: 'gpt-4.1-mini', - GPT_4_1_MINI_2025_04_14: 'gpt-4.1-mini-2025-04-14', - GPT_4_1_NANO: 'gpt-4.1-nano', - GPT_4O: 'gpt-4o', - GPT_4_1_NANO_2025_04_14: 'gpt-4.1-nano-2025-04-14', - GPT_4O_2024_08_06: 'gpt-4o-2024-08-06', GPT_5: 'gpt-5', - GPT_4O_2024_05_13: 'gpt-4o-2024-05-13', - GPT_5_2025_08_07: 'gpt-5-2025-08-07', - GPT_4O_2024_11_20: 'gpt-4o-2024-11-20', - GPT_5_CHAT_LATEST: 'gpt-5-chat-latest', - GPT_4O_AUDIO_PREVIEW: 'gpt-4o-audio-preview', GPT_5_MINI: 'gpt-5-mini', - GPT_4O_AUDIO_PREVIEW_2024_10_01: 'gpt-4o-audio-preview-2024-10-01', - GPT_5_MINI_2025_08_07: 'gpt-5-mini-2025-08-07', - GPT_4O_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-audio-preview-2024-12-17', GPT_5_NANO: 'gpt-5-nano', - GPT_4O_AUDIO_PREVIEW_2025_06_03: 'gpt-4o-audio-preview-2025-06-03', + 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', - CHATGPT_4O_LATEST: 'chatgpt-4o-latest', - O1: 'o1', - CODEX_MINI_LATEST: 'codex-mini-latest', - O1_2024_12_17: 'o1-2024-12-17', - GPT_4O_MINI: 'gpt-4o-mini', - O1_MINI: 'o1-mini', - GPT_4O_MINI_2024_07_18: 'gpt-4o-mini-2024-07-18', - O3: 'o3', - GPT_4: 'gpt-4', - O3_2025_04_16: 'o3-2025-04-16', - GPT_4O_MINI_AUDIO_PREVIEW: 'gpt-4o-mini-audio-preview', + 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', - GPT_4O_MINI_AUDIO_PREVIEW_2024_12_17: 'gpt-4o-mini-audio-preview-2024-12-17', O4_MINI_2025_04_16: 'o4-mini-2025-04-16', - GPT_3_5_TURBO: 'gpt-3.5-turbo', + O3: 'o3', + O3_2025_04_16: 'o3-2025-04-16', O3_MINI: 'o3-mini', - GPT_3_5_TURBO_0301: 'gpt-3.5-turbo-0301', O3_MINI_2025_01_31: 'o3-mini-2025-01-31', - GPT_3_5_TURBO_0613: 'gpt-3.5-turbo-0613', + O1: 'o1', + O1_2024_12_17: 'o1-2024-12-17', O1_PREVIEW: 'o1-preview', - GPT_3_5_TURBO_0125: 'gpt-3.5-turbo-0125', O1_PREVIEW_2024_09_12: 'o1-preview-2024-09-12', - GPT_3_5_TURBO_1106: 'gpt-3.5-turbo-1106', + O1_MINI: 'o1-mini', O1_MINI_2024_09_12: 'o1-mini-2024-09-12', - GPT_3_5_TURBO_16K: 'gpt-3.5-turbo-16k', - GPT_4O_MINI_SEARCH_PREVIEW: 'gpt-4o-mini-search-preview', - GPT_3_5_TURBO_16K_0613: 'gpt-3.5-turbo-16k-0613', - GPT_4O_MINI_SEARCH_PREVIEW_2025_03_11: 'gpt-4o-mini-search-preview-2025-03-11', + 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_1106_PREVIEW: 'gpt-4-1106-preview', GPT_4_32K: 'gpt-4-32k', GPT_4_32K_0314: 'gpt-4-32k-0314', GPT_4_32K_0613: 'gpt-4-32k-0613', - GPT_4_TURBO: 'gpt-4-turbo', - GPT_4_TURBO_2024_04_09: 'gpt-4-turbo-2024-04-09', - GPT_4_TURBO_PREVIEW: 'gpt-4-turbo-preview', - GPT_4_VISION_PREVIEW: 'gpt-4-vision-preview', + 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]; @@ -18358,21 +18358,7 @@ 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; - /** - * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. - */ - instructions?: string; - /** - * 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; - /** - * 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; - metadata?: Metadata; + 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. */ @@ -18416,15 +18402,14 @@ export type CreateThreadAndRunRequestWithoutStream = { | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-16k-0613'; - parallel_tool_calls?: ParallelToolCalls; - response_format?: AssistantsApiResponseFormatOption; /** - * 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. - * + * Override the default system message of the assistant. This is useful for modifying the behavior on a per-run basis. */ - temperature?: number; - thread?: CreateThreadRequest; - tool_choice?: AssistantsApiToolChoiceOption & unknown; + 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. * @@ -18445,10 +18430,12 @@ export type CreateThreadAndRunRequestWithoutStream = { vector_store_ids?: Array; }; }; + metadata?: Metadata; /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. + * 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. + * */ - tools?: Array; + 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. * @@ -18456,54 +18443,54 @@ export type CreateThreadAndRunRequestWithoutStream = { * */ top_p?: number; - truncation_strategy?: TruncationObject & unknown; -}; - -export type CreateRunRequestWithoutStream = { /** - * 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. + * 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. + * */ - additional_instructions?: string; + max_prompt_tokens?: number; /** - * Adds additional messages to the thread before creating the run. + * 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. + * */ - additional_messages?: Array; + 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; /** - * 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. - * + * 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. */ - max_completion_tokens?: number; + additional_instructions?: string; /** - * 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. - * + * Adds additional messages to the thread before creating the run. */ - max_prompt_tokens?: number; - metadata?: Metadata; + additional_messages?: Array; /** - * 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. + * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. */ - model?: string | AssistantSupportedModels; - parallel_tool_calls?: ParallelToolCalls; - reasoning_effort?: ReasoningEffort; - response_format?: AssistantsApiResponseFormatOption; + 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; - tool_choice?: AssistantsApiToolChoiceOption & unknown; - /** - * Override the tools the assistant can use for this run. This is useful for modifying the behavior on a per-run basis. - */ - tools?: Array; /** * 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. * @@ -18511,7 +18498,20 @@ export type CreateRunRequestWithoutStream = { * */ 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 = { @@ -18519,14 +18519,14 @@ export type SubmitToolOutputsRunRequestWithoutStream = { * A list of tools for which the outputs are being submitted. */ tool_outputs: Array<{ - /** - * The output of the tool call to be submitted to continue the run. - */ - output?: string; /** * 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; }>; }; @@ -18534,15 +18534,15 @@ export type SubmitToolOutputsRunRequestWithoutStream = { * The status of the run, which can be either `queued`, `in_progress`, `requires_action`, `cancelling`, `cancelled`, `failed`, `completed`, `incomplete`, or `expired`. */ export const RunStatus = { - CANCELLED: 'cancelled', + QUEUED: 'queued', + IN_PROGRESS: 'in_progress', + REQUIRES_ACTION: 'requires_action', CANCELLING: 'cancelling', - COMPLETED: 'completed', - EXPIRED: 'expired', + CANCELLED: 'cancelled', FAILED: 'failed', + COMPLETED: 'completed', INCOMPLETE: 'incomplete', - IN_PROGRESS: 'in_progress', - QUEUED: 'queued', - REQUIRES_ACTION: 'requires_action', + EXPIRED: 'expired', } as const; /** @@ -18571,25 +18571,25 @@ export type ListAssistantsData = { 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * 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. + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. * */ - before?: string; + order?: 'asc' | 'desc'; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * 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. * */ - order?: 'asc' | 'desc'; + before?: string; }; url: '/assistants'; }; @@ -18761,14 +18761,6 @@ export type ListBatchesResponse2 = ListBatchesResponses[keyof ListBatchesRespons export type CreateBatchData = { body: { - /** - * The time frame within which the batch should be processed. Currently only `24h` is supported. - */ - completion_window: '24h'; - /** - * 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 ID of an uploaded file that contains requests for the new batch. * @@ -18778,6 +18770,14 @@ export type CreateBatchData = { * */ 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; }; @@ -18842,13 +18842,9 @@ export type ListChatCompletionsData = { path?: never; query?: { /** - * Identifier for the last chat completion from the previous pagination request. - */ - after?: string; - /** - * Number of Chat Completions to retrieve. + * The model used to generate the Chat Completions. */ - limit?: number; + model?: string; /** * A list of metadata keys to filter the Chat Completions by. Example: * @@ -18857,9 +18853,13 @@ export type ListChatCompletionsData = { */ metadata?: Metadata; /** - * The model used to generate the Chat Completions. + * Identifier for the last chat completion from the previous pagination request. */ - model?: string; + 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`. */ @@ -19018,11 +19018,6 @@ export type ListContainersData = { 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. * @@ -19033,6 +19028,11 @@ export type ListContainersData = { * */ 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'; }; @@ -19106,11 +19106,6 @@ export type ListContainerFilesData = { container_id: string; }; 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. * @@ -19121,6 +19116,11 @@ export type ListContainerFilesData = { * */ 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'; }; @@ -19301,9 +19301,9 @@ export type DeleteEvalResponses = { * Successfully deleted the evaluation. */ 200: { + object: string; deleted: boolean; eval_id: string; - object: string; }; }; @@ -19335,11 +19335,11 @@ export type UpdateEvalData = { * Request to update an evaluation */ body: { - metadata?: Metadata; /** * Rename the evaluation. */ name?: string; + metadata?: Metadata; }; path: { /** @@ -19458,8 +19458,8 @@ export type DeleteEvalRunResponses = { * Successfully deleted the eval run */ 200: { - deleted?: boolean; object?: string; + deleted?: boolean; run_id?: string; }; }; @@ -19537,16 +19537,16 @@ export type GetEvalRunOutputItemsData = { * Number of output items to retrieve. */ limit?: number; - /** - * Sort order for output items by timestamp. Use `asc` for ascending order or `desc` for descending order. Defaults to `asc`. - */ - order?: 'asc' | 'desc'; /** * 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'; }; @@ -19568,14 +19568,14 @@ export type GetEvalRunOutputItemData = { * The ID of the evaluation to retrieve runs for. */ eval_id: string; - /** - * The ID of the output item to retrieve. - */ - output_item_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}'; @@ -19596,10 +19596,9 @@ export type ListFilesData = { 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. - * + * Only return files with the given purpose. */ - after?: string; + 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. * @@ -19611,9 +19610,10 @@ export type ListFilesData = { */ order?: 'asc' | 'desc'; /** - * Only return files with the given purpose. + * 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. + * */ - purpose?: string; + after?: string; }; url: '/files'; }; @@ -19748,6 +19748,10 @@ export type ListFineTuningCheckpointPermissionsData = { 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. */ @@ -19760,10 +19764,6 @@ export type ListFineTuningCheckpointPermissionsData = { * The order in which to retrieve permissions. */ order?: 'ascending' | 'descending'; - /** - * The ID of the project to get permissions for. - */ - project_id?: string; }; url: '/fine_tuning/checkpoints/{fine_tuned_model_checkpoint}/permissions'; }; @@ -20165,15 +20165,15 @@ export type AdminApiKeysListData = { /** * Return keys with IDs that come after this ID in the pagination order. */ - after?: string; - /** - * Maximum number of keys to return. - */ - limit?: number; + 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'; }; @@ -20223,9 +20223,9 @@ export type AdminApiKeysDeleteResponses = { * Confirmation that the API key was deleted. */ 200: { - deleted?: boolean; id?: string; object?: string; + deleted?: boolean; }; }; @@ -20257,24 +20257,6 @@ export type ListAuditLogsData = { body?: never; path?: never; query?: { - /** - * Return only events performed by users with these emails. - */ - 'actor_emails[]'?: 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; - /** - * 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; /** * Return only events whose `effective_at` (Unix seconds) is in this range. */ @@ -20296,23 +20278,41 @@ export type ListAuditLogsData = { */ 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; /** - * Return only events for these projects. + * 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. + * */ - 'project_ids[]'?: Array; + after?: string; /** - * Return only events performed on these targets. For example, a project ID updated. + * 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. + * */ - 'resource_ids[]'?: Array; + before?: string; }; url: '/organization/audit_logs'; }; @@ -20331,15 +20331,15 @@ export type ListOrganizationCertificatesData = { 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; /** * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. * @@ -20487,13 +20487,21 @@ export type UsageCostsData = { path?: never; query: { /** - * Width of each time bucket in response. Currently only `1d` is supported, default to `1d`. + * Start time (Unix seconds) of the query time range, inclusive. */ - bucket_width?: '1d'; + 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. */ @@ -20507,14 +20515,6 @@ export type UsageCostsData = { * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ page?: string; - /** - * Return only costs for these projects. - */ - project_ids?: Array; - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; }; url: '/organization/costs'; }; @@ -20533,15 +20533,15 @@ export type ListInvitesData = { 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; }; url: '/organization/invites'; }; @@ -20620,6 +20620,11 @@ 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. * @@ -20629,11 +20634,6 @@ export type ListProjectsData = { * If `true` returns all projects including those that have been `archived`. Archived projects are not included by default. */ include_archived?: boolean; - /** - * 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: '/organization/projects'; }; @@ -20730,15 +20730,15 @@ export type ListProjectApiKeysData = { }; 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; }; url: '/organization/projects/{project_id}/api_keys'; }; @@ -20756,14 +20756,14 @@ export type ListProjectApiKeysResponse = export type DeleteProjectApiKeyData = { body?: never; path: { - /** - * The ID of the API key. - */ - key_id: string; /** * 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}'; @@ -20791,14 +20791,14 @@ export type DeleteProjectApiKeyResponse = export type RetrieveProjectApiKeyData = { body?: never; path: { - /** - * The ID of the API key. - */ - key_id: string; /** * 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}'; @@ -20845,15 +20845,15 @@ export type ListProjectCertificatesData = { }; 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; /** * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. * @@ -20932,6 +20932,11 @@ export type ListProjectRateLimitsData = { 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. * @@ -20942,11 +20947,6 @@ export type ListProjectRateLimitsData = { * */ before?: string; - /** - * A limit on the number of objects to be returned. The default is 100. - * - */ - limit?: number; }; url: '/organization/projects/{project_id}/rate_limits'; }; @@ -21010,15 +21010,15 @@ export type ListProjectServiceAccountsData = { }; 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; }; url: '/organization/projects/{project_id}/service_accounts'; }; @@ -21140,15 +21140,15 @@ export type ListProjectUsersData = { }; 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; }; url: '/organization/projects/{project_id}/users'; }; @@ -21309,17 +21309,33 @@ export type UsageAudioSpeechesData = { path?: never; query: { /** - * Return only usage for these API keys. + * Start time (Unix seconds) of the query time range, inclusive. */ - api_key_ids?: Array; + 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'; /** - * End time (Unix seconds) of the query time range, exclusive. + * Return only usage for these projects. */ - end_time?: number; + 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. */ @@ -21332,26 +21348,10 @@ export type UsageAudioSpeechesData = { * */ limit?: number; - /** - * Return only usage for these models. - */ - models?: Array; /** * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ page?: string; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * Return only usage for these users. - */ - user_ids?: Array; }; url: '/organization/usage/audio_speeches'; }; @@ -21371,17 +21371,33 @@ export type UsageAudioTranscriptionsData = { path?: never; query: { /** - * Return only usage for these API keys. + * Start time (Unix seconds) of the query time range, inclusive. */ - api_key_ids?: Array; + 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'; /** - * End time (Unix seconds) of the query time range, exclusive. + * Return only usage for these projects. */ - end_time?: number; + 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. */ @@ -21394,26 +21410,10 @@ export type UsageAudioTranscriptionsData = { * */ limit?: number; - /** - * Return only usage for these models. - */ - models?: Array; /** * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ page?: string; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * Return only usage for these users. - */ - user_ids?: Array; }; url: '/organization/usage/audio_transcriptions'; }; @@ -21433,13 +21433,21 @@ export type UsageCodeInterpreterSessionsData = { path?: never; query: { /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + * Start time (Unix seconds) of the query time range, inclusive. */ - bucket_width?: '1m' | '1h' | '1d'; + 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`. */ @@ -21451,19 +21459,11 @@ export type UsageCodeInterpreterSessionsData = { * - `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; - /** - * Return only usage for these projects. - */ - project_ids?: Array; + limit?: number; /** - * Start time (Unix seconds) of the query time range, inclusive. + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ - start_time: number; + page?: string; }; url: '/organization/usage/code_interpreter_sessions'; }; @@ -21483,54 +21483,54 @@ export type UsageCompletionsData = { path?: never; query: { /** - * Return only usage for these API keys. + * Start time (Unix seconds) of the query time range, inclusive. */ - api_key_ids?: Array; + start_time: number; /** - * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. - * + * End time (Unix seconds) of the query time range, exclusive. */ - batch?: boolean; + 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'; /** - * End time (Unix seconds) of the query time range, exclusive. + * Return only usage for these projects. */ - end_time?: number; + project_ids?: Array; /** - * 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. + * Return only usage for these users. */ - group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch'>; + user_ids?: Array; /** - * 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 - * + * Return only usage for these API keys. */ - limit?: number; + api_key_ids?: Array; /** * Return only usage for these models. */ models?: Array; /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + * If `true`, return batch jobs only. If `false`, return non-batch jobs only. By default, return both. + * */ - page?: string; + batch?: boolean; /** - * Return only usage for these projects. + * 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. */ - project_ids?: Array; + group_by?: Array<'project_id' | 'user_id' | 'api_key_id' | 'model' | 'batch'>; /** - * Start time (Unix seconds) of the query time range, inclusive. + * 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 + * */ - start_time: number; + limit?: number; /** - * Return only usage for these users. + * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ - user_ids?: Array; + page?: string; }; url: '/organization/usage/completions'; }; @@ -21549,17 +21549,33 @@ export type UsageEmbeddingsData = { path?: never; query: { /** - * Return only usage for these API keys. + * Start time (Unix seconds) of the query time range, inclusive. */ - api_key_ids?: Array; + 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'; /** - * End time (Unix seconds) of the query time range, exclusive. + * Return only usage for these projects. */ - end_time?: number; + 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. */ @@ -21572,26 +21588,10 @@ export type UsageEmbeddingsData = { * */ limit?: number; - /** - * Return only usage for these models. - */ - models?: Array; /** * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ page?: string; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * Return only usage for these users. - */ - user_ids?: Array; }; url: '/organization/usage/embeddings'; }; @@ -21610,57 +21610,57 @@ export type UsageImagesData = { path?: never; query: { /** - * Return only usage for these API keys. - */ - api_key_ids?: Array; - /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + * Start time (Unix seconds) of the query time range, inclusive. */ - bucket_width?: '1m' | '1h' | '1d'; + start_time: number; /** * End time (Unix seconds) of the query time range, exclusive. */ end_time?: number; /** - * 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 - * + * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. */ - limit?: number; + bucket_width?: '1m' | '1h' | '1d'; /** - * Return only usage for these models. + * Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them. */ - models?: Array; + sources?: Array<'image.generation' | 'image.edit' | 'image.variation'>; /** - * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. + * Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. */ - page?: string; + sizes?: Array<'256x256' | '512x512' | '1024x1024' | '1792x1792' | '1024x1792'>; /** * Return only usage for these projects. */ project_ids?: Array; /** - * Return only usages for these image sizes. Possible values are `256x256`, `512x512`, `1024x1024`, `1792x1792`, `1024x1792` or any combination of them. + * Return only usage for these users. */ - sizes?: Array<'256x256' | '512x512' | '1024x1024' | '1792x1792' | '1024x1792'>; + user_ids?: Array; /** - * Return only usages for these sources. Possible values are `image.generation`, `image.edit`, `image.variation` or any combination of them. + * Return only usage for these API keys. */ - sources?: Array<'image.generation' | 'image.edit' | 'image.variation'>; + api_key_ids?: Array; /** - * Start time (Unix seconds) of the query time range, inclusive. + * Return only usage for these models. */ - start_time: number; + models?: Array; /** - * Return only usage for these users. + * 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. */ - user_ids?: Array; + 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'; }; @@ -21679,17 +21679,33 @@ export type UsageModerationsData = { path?: never; query: { /** - * Return only usage for these API keys. + * Start time (Unix seconds) of the query time range, inclusive. */ - api_key_ids?: Array; + 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'; /** - * End time (Unix seconds) of the query time range, exclusive. + * Return only usage for these projects. */ - end_time?: number; + 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. */ @@ -21702,26 +21718,10 @@ export type UsageModerationsData = { * */ limit?: number; - /** - * Return only usage for these models. - */ - models?: Array; /** * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ page?: string; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; - /** - * Return only usage for these users. - */ - user_ids?: Array; }; url: '/organization/usage/moderations'; }; @@ -21740,13 +21740,21 @@ export type UsageVectorStoresData = { path?: never; query: { /** - * Width of each time bucket in response. Currently `1m`, `1h` and `1d` are supported, default to `1d`. + * Start time (Unix seconds) of the query time range, inclusive. */ - bucket_width?: '1m' | '1h' | '1d'; + 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`. */ @@ -21763,14 +21771,6 @@ export type UsageVectorStoresData = { * A cursor for use in pagination. Corresponding to the `next_page` field from the previous response. */ page?: string; - /** - * Return only usage for these projects. - */ - project_ids?: Array; - /** - * Start time (Unix seconds) of the query time range, inclusive. - */ - start_time: number; }; url: '/organization/usage/vector_stores'; }; @@ -21789,6 +21789,11 @@ 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. * @@ -21798,11 +21803,6 @@ export type ListUsersData = { * Filter by the email address of users. */ emails?: 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; }; url: '/organization/users'; }; @@ -21982,29 +21982,29 @@ export type GetResponseData = { */ include?: Array; /** - * 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. + * 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. * */ - include_obfuscation?: boolean; + stream?: boolean; /** * The sequence number of the event after which to start streaming. * */ starting_after?: 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 below](https://platform.openai.com/docs/api-reference/responses-streaming) - * for more information. + * 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. * */ - stream?: boolean; + include_obfuscation?: boolean; }; url: '/responses/{response_id}'; }; @@ -22054,9 +22054,22 @@ export type ListInputItemsData = { /** * The ID of the response to retrieve input items for. */ - response_id: string; - }; - query?: { + 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. * @@ -22073,19 +22086,6 @@ export type ListInputItemsData = { * */ include?: 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; - /** - * 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'; }; url: '/responses/{response_id}/input_items'; }; @@ -22205,25 +22205,25 @@ export type ListMessagesData = { }; 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * 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. + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. * */ - before?: string; + order?: 'asc' | 'desc'; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * 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. * */ - order?: 'asc' | 'desc'; + before?: string; /** * Filter messages by the run ID that generated them. * @@ -22266,14 +22266,14 @@ export type CreateMessageResponse = CreateMessageResponses[keyof CreateMessageRe export type DeleteMessageData = { body?: never; path: { - /** - * The ID of the message to delete. - */ - message_id: string; /** * 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}'; @@ -22291,14 +22291,14 @@ export type DeleteMessageResponse2 = DeleteMessageResponses[keyof DeleteMessageR export type GetMessageData = { body?: never; path: { - /** - * The ID of the message to retrieve. - */ - message_id: string; /** * 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}'; @@ -22316,14 +22316,14 @@ export type GetMessageResponse = GetMessageResponses[keyof GetMessageResponses]; export type ModifyMessageData = { body: ModifyMessageRequest; path: { - /** - * The ID of the message to modify. - */ - message_id: string; /** * 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}'; @@ -22348,25 +22348,25 @@ export type ListRunsData = { }; 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * 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. + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. * */ - before?: string; + order?: 'asc' | 'desc'; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * 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. * */ - order?: 'asc' | 'desc'; + before?: string; }; url: '/threads/{thread_id}/runs'; }; @@ -22412,14 +22412,14 @@ export type CreateRunResponse = CreateRunResponses[keyof CreateRunResponses]; export type GetRunData = { body?: never; path: { - /** - * The ID of the run to retrieve. - */ - run_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 to retrieve. + */ + run_id: string; }; query?: never; url: '/threads/{thread_id}/runs/{run_id}'; @@ -22437,14 +22437,14 @@ export type GetRunResponse = GetRunResponses[keyof GetRunResponses]; export type ModifyRunData = { body: ModifyRunRequest; path: { - /** - * The ID of the run to modify. - */ - run_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 to modify. + */ + run_id: string; }; query?: never; url: '/threads/{thread_id}/runs/{run_id}'; @@ -22462,14 +22462,14 @@ export type ModifyRunResponse = ModifyRunResponses[keyof ModifyRunResponses]; export type CancelRunData = { body?: never; path: { - /** - * The ID of the run to cancel. - */ - run_id: string; /** * 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'; @@ -22487,16 +22487,26 @@ export type CancelRunResponse = CancelRunResponses[keyof CancelRunResponses]; export type ListRunStepsData = { body?: never; path: { - /** - * The ID of the run the run steps belong to. - */ - run_id: string; /** * 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. * @@ -22514,16 +22524,6 @@ export type ListRunStepsData = { * */ 'include[]'?: Array<'step_details.tool_calls[*].file_search.results[*].content'>; - /** - * 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'; }; url: '/threads/{thread_id}/runs/{run_id}/steps'; }; @@ -22540,6 +22540,10 @@ export type ListRunStepsResponse2 = ListRunStepsResponses[keyof ListRunStepsResp 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. */ @@ -22548,10 +22552,6 @@ export type GetRunStepData = { * The ID of the run step to retrieve. */ step_id: string; - /** - * The ID of the thread to which the run and run step belongs. - */ - thread_id: string; }; query?: { /** @@ -22577,14 +22577,14 @@ export type GetRunStepResponse = GetRunStepResponses[keyof GetRunStepResponses]; export type SubmitToolOuputsToRunData = { body: SubmitToolOutputsRunRequest; path: { - /** - * The ID of the run that requires the tool output submission. - */ - run_id: string; /** * 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'; @@ -22687,25 +22687,25 @@ export type ListVectorStoresData = { 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. + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. * */ - after?: string; + limit?: number; /** - * 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. + * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. * */ - before?: string; + order?: 'asc' | 'desc'; /** - * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 20. + * 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. * */ - limit?: number; + after?: string; /** - * Sort order by the `created_at` timestamp of the objects. `asc` for ascending order and `desc` for descending order. + * 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. * */ - order?: 'asc' | 'desc'; + before?: string; }; url: '/vector_stores'; }; @@ -22827,14 +22827,14 @@ export type CreateVectorStoreFileBatchResponse = export type GetVectorStoreFileBatchData = { body?: never; path: { - /** - * The ID of the file batch being retrieved. - */ - batch_id: string; /** * 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}'; @@ -22853,14 +22853,14 @@ export type GetVectorStoreFileBatchResponse = export type CancelVectorStoreFileBatchData = { body?: never; path: { - /** - * The ID of the file batch to cancel. - */ - batch_id: string; /** * 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'; @@ -22879,16 +22879,26 @@ export type CancelVectorStoreFileBatchResponse = export type ListFilesInVectorStoreBatchData = { body?: never; path: { - /** - * The ID of the file batch that the files belong to. - */ - batch_id: string; /** * 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. * @@ -22903,16 +22913,6 @@ export type ListFilesInVectorStoreBatchData = { * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */ filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; - /** - * 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'; }; url: '/vector_stores/{vector_store_id}/file_batches/{batch_id}/files'; }; @@ -22936,6 +22936,16 @@ export type ListVectorStoreFilesData = { 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. * @@ -22950,16 +22960,6 @@ export type ListVectorStoreFilesData = { * Filter by file status. One of `in_progress`, `completed`, `failed`, `cancelled`. */ filter?: 'in_progress' | 'completed' | 'failed' | 'cancelled'; - /** - * 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'; }; url: '/vector_stores/{vector_store_id}/files'; }; @@ -23000,14 +23000,14 @@ export type CreateVectorStoreFileResponse = export type DeleteVectorStoreFileData = { body?: never; path: { - /** - * The ID of the file to delete. - */ - file_id: string; /** * 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}'; @@ -23026,14 +23026,14 @@ export type DeleteVectorStoreFileResponse2 = export type GetVectorStoreFileData = { body?: never; path: { - /** - * The ID of the file being retrieved. - */ - file_id: string; /** * 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}'; @@ -23052,14 +23052,14 @@ export type GetVectorStoreFileResponse = export type UpdateVectorStoreFileAttributesData = { body: UpdateVectorStoreFileAttributesRequest; path: { - /** - * The ID of the file to update attributes. - */ - file_id: string; /** * 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}'; @@ -23078,14 +23078,14 @@ export type UpdateVectorStoreFileAttributesResponse = export type RetrieveVectorStoreFileContentData = { body?: never; path: { - /** - * The ID of the file within the vector store. - */ - file_id: string; /** * 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'; 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/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'; };